Sort by

recency

|

496 Discussions

|

  • + 0 comments

    Its simplicity and efficiency make it a foundational tool for understanding how computers work at a low level, while still being versatile enough for everything from operating systems to embedded systems. http cricbet99.club

  • + 0 comments

    this problems can be resolved without array #include

    include

    void solve(){ int n; scanf("%d",&n); int sum = 0; // int *arr = malloc((n) * sizeof(int)); for(size_t i = 0;i < n;i++){ int data; scanf("%d",&data); sum += data; } printf("%d",sum);

    } int main(){ solve(); return 0; }

  • + 0 comments

    include

    include

    include

    include

    int main() {

    /* Enter your code here. Read input from STDIN. Print output to STDOUT */  
    int n;
    int sum=0;
    scanf("%d", &n);
    int *arr = (int*)malloc(n * sizeof(int));
    if (n >= 1 && n <= 1000)
    {
        //phase 1: input
        for (int i = 0; i < n; i++){
        scanf("%d", &arr[i]);
        }
        // phase 2: output
        for (int i= 0; i<n; i++){
            sum += arr[i];
        }
    
    }
      printf("%d\n", sum);
      free(arr);
    return 0;
    

    }

  • + 0 comments

    Here is 1D Arrays in C problem solution - https://programmingoneonone.com/hackerrank-1d-arrays-in-c-solution.html

  • + 0 comments

    include

    include

    include

    include

    int main(){ int n, sum=0; scanf("%d",&n);

    int *arr = (int*)malloc(n * sizeof(int));
    
    for(int i; i < n; i++){
        scanf("%d", &arr[i]);
        sum+=arr[i];
    }
    printf("%d",sum);
    free(arr);
    

    }