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

Answer Posted / neha shree

void main()
{
int a,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 ?    9 Yes 12 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between c &c++?

641


Can a pointer point to null?

579


What is the translation phases used in c language?

623


What are the types of operators in c?

606


What does a function declared as pascal do differently?

599






The number of measuring units from an arbitarary starting point in a record,area,or control block to some other point a) recording pointer b) offset c) branching d) none

702


Where is volatile variable stored?

639


If the size of int data type is two bytes, what is the range of signed int data type?

581


What are the different properties of variable number of arguments?

657


What is the role of && operator in a program code?

562


Explain what are the different data types in c?

746


what are the different storage classes in c?

657


what is the syallabus of computer science students in group- 1?

1832


What is the c value paradox and how is it explained?

568


main() { printf("hello"); fork(); }

685