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
What is the use of sizeof () in c?
What are different types of pointers?
why programs in c are running with out #include
What is the size of structure pointer in c?
Why doesnt this code work?
Write a program on swapping (100, 50)
Program will then find the largest of three numbers using nested if-else statements. User is prompted to enter three numbers. Program will find the largest number and display it on the screen. All three numbers entered by the user are also displayed. If user enters 21, 33, and 5, the output should be as follows: You entered: 21, 33 and 5. The largest number is 33.
Why we use break in c?
What happens if a header file is included twice?
What are header files? What are their uses?
Explain output of printf("Hello World"-'A'+'B'); ?
Explain what is meant by high-order and low-order bytes?
Can you write the function prototype, definition and mention the other requirements.
Should a function contain a return statement if it does not return a value?
How to check whether string is a palindrome, WITHOUT USING STRING FUNCTIONS?