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

how could explain about job profile

1462


What is the difference between text and binary i/o?

606


Is malloc memset faster than calloc?

628


Why do we need a structure?

603


Why is c called a mid-level programming language?

737






When can you use a pointer with a function?

578


What is the collection of communication lines and routers called?

624


What is a macro?

667


Subtract Two Number Without Using Subtraction Operator

364


How to set file pointer to beginning c?

681


What is the difference between scanf and fscanf?

677


Explain what are the advantages and disadvantages of a heap?

607


Did c have any year 2000 problems?

664


Is swift based on c?

650


#include #include struct stu { int i; char j; }; union uni { int i; char j; }; void main() { int j,k; clrscr(); struct stu s; j=sizeof(s); printf("%d",j); union uni u; k=sizeof(u); printf("%d",k); getch(); } what is value of j and k.

5227