Answer Posted / d. prashant
#include<stdio.h>
#include<conio.h>
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 ? | 7 Yes | 3 No |
Post New Answer View All Answers
How many keywords are there in c?
Are negative numbers true in c?
Explain about the functions strcat() and strcmp()?
Here is a good puzzle: how do you write a program which produces its own source code as output?
#define MAX(x,y) (x) >(y)?(x):(y) main() { inti=10,j=5,k=0; k= MAX(i++,++j); printf("%d..%d..%d",i,j,k); }
What does the && operator do in a program code?
Which of the following operators is incorrect and why? ( >=, <=, <>, ==)
what will be the output for the following main() { printf("hi" "hello"); }
What are identifiers in c?
Explain the meaning of keyword 'extern' in a function declaration.
what is recursion in C
Who invented b language?
what are the advanced features of functions a) function declaration and prototypes b) calling functions by value or by reference c) recursion d) all the above
What do you understand by friend-functions? How are they used?
FILE PROGRAMMING