answersLogoWhite

0

THIS IS ONLY FOR UPTO A FIVE DIGIT NO. BY ROHAN ARORA



#include
#include
void main()
{
int a,n,s,sum=0;
clrscr();
printf("Enter the number between 1 to 5 digits\n");
scanf("%d",&a);
while(a!=0)
{
n=a%10;
sum=sum+n;
a=a/10;
}


printf("The sum of digits of the given numberis %d",sum);
getch();
}

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

Can we add website link when we write java program?

yes ,i can add the website link in java program when we write.


Write down four odd digits that will add up to 19?

There are no four odd numbers that will add up to nineteen.


Include zeros in 2.25 million?

Million is the name given to a number with 7 digits in front of the decimal place. In order to write out any number take the number you are given and and move the decimal place to the right until you have 7 digits in front of the decimal. add zeros to the end until it has 7 digits in front of the decimal place. So 2.25 million would be 2,250,000.


Write a program to add two 8 bit numbers in microprocessor 8051?

write it in 8085


What is less than 60 and greater than 55 If you add the digits the sum is 13 Write the number?

58


Write down 4 odd digits that will add up to 19?

23


It is less than 60 and greater than 55 If you add the digits the sum is 13 Write the number?

58


It is greater than 30 and less than 40 if you add the digits the sum is 10 write the number?

37


How do you go about finding the digit sum of a number?

-- List the digits that are used to write the number. -- Add up the list.


How can you write a program to find the mean resistance in c language given the values of 8 resistances?

"Mean" usually means "average", so you just add the numbers together, then divide by 8.


Write a c program add two polynomial using link list?

GOUDHMARINI


Write 53.62 billion in digits?

You must add 9 digits (or 12 digits, depending on the country) after the decimal point, and eliminate the decimal point. Thus (assuming the "short scale") you get: 53,620,000,000.You must add 9 digits (or 12 digits, depending on the country) after the decimal point, and eliminate the decimal point. Thus (assuming the "short scale") you get: 53,620,000,000.You must add 9 digits (or 12 digits, depending on the country) after the decimal point, and eliminate the decimal point. Thus (assuming the "short scale") you get: 53,620,000,000.You must add 9 digits (or 12 digits, depending on the country) after the decimal point, and eliminate the decimal point. Thus (assuming the "short scale") you get: 53,620,000,000.