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 / rajrartan singh

#include<stdio.h>
#include<conio.h>
void main();
{
int n,d1,d2,d3,d4,d5,sum;
ptintf("enter the five digit no.");
scanf("d",&n);
s=d1+d2+d3+d4+d5;
getch();
}

Is This Answer Correct ?    4 Yes 10 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is c language still used?

953


Explain how can I read and write comma-delimited text?

1131


When should the volatile modifier be used?

1126


Can static variables be declared in a header file?

1030


Is there any algorithm to search a string in link list in the minimum time?(please do not suggest the usual method of traversing the link list)

2259


Can a file other than a .h file be included with #include?

1127


Tell me when is a void pointer used?

1132


Tell me about low level programming languages.

1085


What is the best way to comment out a section of code that contains comments?

1298


Write a program to show the change in position of a cursor using c

1015


What is realloc in c?

1043


How can I write a function that takes a format string and a variable number of arguments?

1014


Differentiate between a for loop and a while loop? What are it uses?

1150


How many types of errors are there in c language? Explain

948


What does %c mean in c?

1037