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

Why main function is special give two reasons?

949


What do you mean by recursion in c?

626


Stimulate calculator using Switch-case-default statement for two numbers

2448


Explain what is the difference between null and nul?

658


How is actual parameter different from the formal parameter?

591






what is diffrence between linear and binary search in array respect to operators?what kind of operator can be used in both seach methods?

1451


How can a program be made to print the line number where an error occurs?

652


Write a program to generate random numbers in c?

664


how to print the character with maximum occurence and print that number of occurence too in a string given ?

2036


a value that does not change during program execution a) variabe b) argument c) parameter d) none

696


What is strcpy() function?

657


What is formal argument?

652


How does normalization of huge pointer works?

640


Explain how do you declare an array that will hold more than 64kb of data?

904


Which built-in library function can be used to match a patter from the string?

747