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
What is the g value paradox?
Explain how do you declare an array that will hold more than 64kb of data?
Why can't I perform arithmetic on a void* pointer?
In C programming, what command or code can be used to determine if a number of odd or even?
#include main() { enum _tag{ left=10, right, front=100, back}; printf("left is %d, right is %d, front is %d, back is %d",left,right,front,back); }
What is boolean in c?
why use "return" statement a) on executing the return statement it immediately transfers the control back to the calling program b) it returns the value present in the parentheses return, to the calling program c) a & b d) none of the above
write a program in C that prompts the user for today's date,tomorrow's date and display the results.Use structures for today's date,tomorrow's date and an array to hold the days for each month of the year.
Describe the difference between = and == symbols in c programming?
Can a pointer be static?
Can a function be forced to be inline? Also, give a comparison between inline function and the C macro?
Why is c called a mid-level programming language?
Explain built-in function?
Can stdout be forced to print somewhere other than the screen?
Why header file is used in c?