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 / guest

#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%10);
n=n/10;
}
printf("sum is %d",sum);
return 0;
}

Is This Answer Correct ?    16 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is getch?

1170


what is different between auto and local static? why should we use local static?

1114


What are shell structures used for?

1029


Why do we use c for the speed of light?

1171


what is the format specifier for printing a pointer value?

1005


I completed my B.tech (IT). Actually I want to develop virtual object that which will change software technology in the future. To develop virtual object what course I have to take. can I any professor to help me.

2213


How are structure passing and returning implemented?

1023


How can I call system when parameters (filenames, etc.) Of the executed command arent known until run time?

1090


how logic is used

1952


Can you subtract pointers from each other? Why would you?

940


What is meant by realloc()?

1122


What are qualifiers and modifiers c?

988


Can we declare variable anywhere in c?

954


What is the difference between fread and fwrite function?

1067


What are the types of arrays in c?

1159