Answer Posted / pankaj khaitan
main()
{
int n,i,sum=0,r;
printf("enter the value");
scanf("%d",&n);
while(n)
{
rem=num%10;
sum=sum+rem;
num=num/10;
}
printf("sum = %d",sum);
}
| Is This Answer Correct ? | 40 Yes | 15 No |
Post New Answer View All Answers
Why we use break in c?
Write a program to reverse a given number in c?
Why #include is used in c language?
In C, What is the #line used for?
1) write a program to generate 1st n fibonacci prime numbers using Nested if 2) write a program to generate twin prime numbers from m to n using nested if 3) write a program to check whether a given integer is a strong number or not using nested if 4) Write a program to generate prime factors of a given integer using nested if 5)write a program to generate prime numbers from m to n using nested if 6)write a program to generate perfect numbers from m to n using nested if 7)write a program to generate the pallindromes from m to n using neste if 8)write a program to generate armstrong numbers from m to n using nested if 9)write a program to generate strong numbers from m to n using nested if
What is .obj file in c?
What is the difference between null pointer and wild pointer?
What are called c variables?
What is union and structure in c?
What are the advantages of using macro in c language?
What happens if a header file is included twice?
How do you define structure?
What is the difference between struct and union in C?
Explain how many levels deep can include files be nested?
Explain the properties of union.