Answer Posted / rajan praksh more (vangani-tha
#include<stdio.h>
#include<conio.h>
void main()
{
int rem,a;
int sum=0;
clrscr();
printf("Enter The Number: ");
scanf("%d",&a);
while(a>0)
{
rem=a%10;
sum=sum+rem;
a=a/10;
}
printf("sum of digits of entered number is =%d",sum);
getch();
}
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
Why is extern used in c?
How can I read/write structures from/to data files?
What is const keyword in c?
Explain the use of 'auto' keyword in c programming?
Does sprintf put null character?
Explain how can you determine the size of an allocated portion of memory?
Why is c so powerful?
Why does this code crash?
write a program to input 10 strings and compare without using strcmp() function. If the character of one string matches with the characters of another string , sort them and make it a single string ??? example:- str1="Aakash" st2="Himanshu" str="Uday" output:- Aakashimanshuday (please post the answer as quickly as possible)
What are pointers? Why are they used?
Why should I prototype a function?
What is a const pointer in c?
What are types of preprocessor in c?
What is the use of #include in c?
Is javascript written in c?