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

Which header file is used for clrscr?

565


What is bss in c?

592


What are the advantages and disadvantages of c language?

550


Explain c preprocessor?

672


what is the role you expect in software industry?

1644






Can you pass an entire structure to functions?

685


What does c in a circle mean?

567


what is the basis for selection of arrays or pointers as data structure in a program

3780


Tell me what is the purpose of 'register' keyword in c language?

605


Which is best linux os?

550


What is time null in c?

571


how to find anagram without using string functions using only loops in c programming

2707


What is the hardest programming language?

658


Is c a great language, or what?

594


What are the different types of control structures?

573