Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

What is switch in c?

1160


What is the difference between union and anonymous union?

1373


What is NULL pointer?

1144


How can I open files mentioned on the command line, and parse option flags?

1104


Are comments included during the compilation stage and placed in the EXE file as well?

1127


What are multidimensional arrays?

1170


which of the following shows the correct hierarchy of arithmetic operations in C a) (), **, * or/,+ or - b) (),**,*,/,+,- c) (),**,/,*,+,- d) (),/ or *,- or +

1779


What is the difference between specifying a constant variable like with constant keyword and #define it? i.e what is the difference between CONSTANT FLOAT A=1.25 and #define A 1.25

2041


Is there any demerits of using pointer?

1114


Where are local variables stored in c?

1091


Dont ansi function prototypes render lint obsolete?

1196


What could possibly be the problem if a valid function name such as tolower() is being reported by the C compiler as undefined?

1329


What is the purpose of main() function?

1303


Differentiate between full, complete & perfect binary trees.

1169


Does c have an equivalent to pascals with statement?

1062