See what questions your friends are asking today.

Program in c language to find the sum of digits?

View Slide Show

Close
Answer:
#include <stdio.h>
void main()
{
int digi,num,i,sum=0;


printf("Enter the number of digits:");
scanf("%d",&num);

while(i>0);
{
for(i=0;i<10000;i++)
{
digi=num;
i=digi%10;
sum=sum+i;
num=digi/10;
}
printf("The sum of digits entered is %d",sum);
}
}

More on: C Programming

Lazy copying is a hybrid of the standard shallow-copy and deep-copy mechanisms. Objects that are copy constructed or assigned from... more »
Matrix multiplication using pointers 1. Why use it? Hi, so I've been looking for this answer myself and because it was not created... more »

Top Questions

Answer"near" and "far" pointers are actually non-standard qualifiers that you'll find...
Answer A near pointer is a 16 bit pointer to an object contained in the current segment,...
The function returns the total number of items successfully read, EOF when the input...

Contributors

Top Contributors This Week

  • Trust Points: 46
  • Member Since: 5/13
  • Trust Points: 76
  • Member Since: 3/08
  • Trust Points: 2367
  • Member Since: 3/09
  • Trust Points: 2793
  • Member Since: 6/07
  • Trust Points: 2304
  • Member Since: 11/11