We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- C
- Arrays and Strings
- 1D Arrays in C
- Discussions
1D Arrays in C
1D Arrays in C
Sort by
recency
|
492 Discussions
|
Please Login in order to post a comment
include
include
include
include
int main(){ int n, sum=0; scanf("%d",&n);
}
include
include
include
include
int main(){ int n, sum=0; scanf("%d",&n);
}
include
include
include
include
int main() {
}
**explian please why 'sum'?
for(int i=0;i
because we have to print sum in output. So , in for loop we traverse all element and add it in variable names sum and display it eg - we have array={1,2,3,4,5} when we run loop from i=0 it add a[0] (i.e - 1) in sum variable , similarly we run it till i=4 (i.e -5) . so sum=1+2+3+4+5
i'm not good in explaining but hope it helps :)
thanku so much i got it :) thanku is less to u. u solve my problem in a second. i search this so much on chatgpt also but dont got this :)
include
include
include
include
int main() { int n; scanf("%d", &n);
}
int main() {
}