write a 'c' program to sum the number of integer values

Answer Posted / chandra

#include<stdio.h>
#include<conio.h>
main()
{
int a[25],n,i,sum=0;
printf("enter n value");
scanf("%d",&n);
printf("\n Enter the numbers");
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
for(i=0;i<n;i++)
sum+=a[i];
printf("\nSum of the given numbers is %d",sum);
}

Is This Answer Correct ?    11 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

my project name is adulteration of chille powder.how can i explain it to the hr when he asks me about the project?

1326


What is omp_num_threads?

814


Why can’t we compare structures?

1030


Explain what is the use of a semicolon (;) at the end of every program statement?

945


How can I use a preprocessorif expression to ?

774


What are enumerated types?

833


Once I have used freopen, how can I get the original stdout (or stdin) back?

819


What is the use of void pointer and null pointer in c language?

827


Why doesnt this code work?

798


main use of recursive function a) processing speed high b) reduce program length/reduce repeated statements c) if you do not, use iterative methods like, for, while or do-while d) all the above

843


Explain what are multidimensional arrays?

801


What is c standard library?

885


What is difference between structure and union in c?

721


Differentiate between the = symbol and == symbol?

914


What is the c language function prototype?

843