how to find sum of 5 digits in C?

Answer Posted / deepshree sinha

#include<stdio.h>
#include,conio.h>
void main()
{
int i,a[6],s=0;
printf("enter the values");
for(i=0;i<5;i++)
{
scanf("%d ",7a[i]);
s=s+a[i];
}
printf("sum of five digits=%d',s);
getch();
}

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How is pointer initialized in c?

592


Explain how do you determine the length of a string value that was stored in a variable?

676


how to write a c program to print list of fruits in alpabetical order?

1802


c language interview questions & answer

1465


Where define directive used?

611






What is an expression?

664


what is recursion in C

620


In c language can we compile a program without main() function?

585


hi to every one .. how to view table pool after creating the pooled table? plz help me.. if any knows abt this ..

1471


How can I do graphics in c?

601


Is it better to bitshift a value than to multiply by 2?

664


What is a macro?

661


a c code by using memory allocation for add ,multiply of sprase matrixes

2306


Are global variables static in c?

681


Describe the header file and its usage in c programming?

626