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

Process by which one bit pattern in to another by bit wise operation is?

720


what are the advanced features of functions a) function declaration and prototypes b) calling functions by value or by reference c) recursion d) all the above

771


What is static function in c?

726


What would happen to X in this expression: X += 15; (assuming the value of X is 5)

1431


How does pointer work in c?

723






What is || operator and how does it function in a program?

723


Why double pointer is used in c?

658


how to capitalise first letter of each word in a given string?

1530


When would you use a pointer to a function?

672


What do the functions atoi(), itoa() and gcvt() do?

815


In the DOS enveronment, normal RAM that resides beyond the 1mb mark. a) expanded memory b) swapped memory c) Extended memory d) none

843


what are the 10 different models of writing an addition program in C language?

1531


what is a constant pointer in C

771


find the value of y y = 1.5x+3 for x<=2 y = 2x+5 for x>2

1629


What is pointer to pointer in c?

746