Answer Posted / vani
//sum of digits in c//
#include<stdio.h>
#include<conio.h>
void main()
{
int n,r,sum=0;
clrscr();
printf("\n enter the number:");
scanf("%d",&n);
while(n!=0)
{
r=n%10;
sum=sum+r;
n=n/10;
}
printf("sum=%d");
getch();
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What are the different types of C instructions?
why wipro wase
What is an auto keyword in c?
What are runtime error?
What's a good way to check for "close enough" floating-point equality?
What is merge sort in c?
What is ponter?
What does 3 periods mean in texting?
Explain how do you sort filenames in a directory?
What do mean by network ?
What is c mainly used for?
What is c value paradox explain?
Write a C program on Centralized OLTP, Decentralized OLTP using locking mechanism, Semaphore using locking mechanism, Shared memory, message queues, channel of communication, sockets and a simple program on Saving bank application program using OLTP in IPC?
Are the expressions * ptr ++ and ++ * ptr same?
What is dynamic dispatch in c++?