how to find sum of 5 digits in C?

Answer Posted / rohit

#include<stdio.h>
int main()
{
int n,sum=0;
printf("enter number");
scanf("%d".&n);
for(int i=0;i<5;i++)
{
sum=sum+n;
}
printf("sum is %d",sum);
return 0;
}

Is This Answer Correct ?    2 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain void pointer?

582


Is it possible to pass an entire structure to functions?

548


How many data structures are there in c?

609


What is wrong in this statement?

595


What is array of structure in c?

587






What is pointer and structure in c?

558


What are the disadvantages of external storage class?

582


What is 02d in c?

622


Can we use any name in place of argv and argc as command line arguments?

602


What are the main characteristics of c language describe the structure of ac program?

604


Is there sort function in c?

570


What is sizeof c?

598


What is the difference between procedural and declarative language?

638


Write a function that will take in a phone number and output all possible alphabetical combinations

592


How can you check to see whether a symbol is defined?

583