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
Difference between goto, long jmp() and setjmp()?
simple program of graphics and their output display
How will you write a code for accessing the length of an array without assigning it to another variable?
A character flag or control mechanism that delineates one data item from another a) variable b) constant c) delimiter d) call by reference
Why is c fast?
What does c mean?
in linking some of os executables are linking name some of them
Explain the difference between malloc() and calloc() in c?
What does nil mean in c?
‘ C’ PROGRAME TO SHOW THE TYPE OF TRANGLE BY ACCEPTING IT’S LENGTH .
What is a scope resolution operator in c?
Find duplicates in a file containing 6 digit number (like uid) in O (n) time.
Is c procedural or object oriented?
#include
Create a structure to specify data on students as given below: Roll number, Name, Department, Course, and Year of joining. Assume that there are not more than 450 students in the collage. (a) Write a function to print the names of all students who joined in the last 3 years. (b) Write a function to print the data of a student whose roll numbers are divisible by 4.