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...

if a five digit number is input through the keyboard, write
a program to calculate the sum of its digits.
(hint:-use the modulus operator.'%')

Answer Posted / saurabh vyas

main()
{
int num=0,sum=0,k=0;
pirntf("enter the number\n");
scanf("%d",&num);
while(num!=0);
{
k=num%10;
sum=sum+k;
num=num/10;
}
printf("%d",sum);
}

Is This Answer Correct ?    4 Yes 9 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

In this problem you are to write a program that will cut some number of prime numbers from the list of prime numbers between 1 and N.Your program will read in a number N; determine the list of prime numbers between 1 and N; and print the C*2 prime numbers from the center of the list if there are an even number of prime numbers or (C*2)-1 prime numbers from the center of the list if there are an odd number of prime numbers in the list.

1796


How to find a missed value, if you want to store 100 values in a 99 sized array?

1363


Can variables be declared anywhere in c?

1035


What is I ++ in c programming?

1059


What is pointer & why it is used?

1061


Explain what are the different file extensions involved when programming in c?

1051


explain what are actual arguments?

1031


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

997


How would you rename a function in C?

994


Can the curly brackets { } be used to enclose a single line of code?

1119


hi friends how r u as soon in satyam my interview is start but i m very confusued ta wat i do plz help me frndz wat can i do plz tell me some question and answers related with "C" which r asked in the interview .

2392


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

915


how to solve "unable to open stdio.h and conio.h header files in windows 7 by using Dos-box software

3258


Explain how do you determine whether to use a stream function or a low-level function?

1025


Explain the difference between strcpy() and memcpy() function?

948