What would you like to do?

Program in c language to find the sum of digits?

already exists.

Would you like to merge this question into it?

already exists as an alternate of this question.

Would you like to make it the primary and merge this question into it?

exists and is an alternate of .

#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);
}
}
5 people found this useful
Thanks for the feedback!

C program for sum of first and last digit of a number?

/*this v'll work to obtain sum of 1st and last number of any number */ #include int main() { int num,sum=0,i,fd,ld; printf("enter the number); . scanf("%d",&nu

Program to find sum of two numbers in VB.NET language?

Option Explicit Dim a as integer Dim b as integer Dim c as integer Dim result as integer a=val(text1.text) b=val(text2.text) c=val(text3.text) result=a+b+c

C program to find the sum of the digits of a number?

Here You go........... # include # include void main() { int no,sum=0,rem=0; clrscr(); printf("\nEnter a Number: "); scanf("%d",&no); while(no>0) { rem=no%10; sum=sum+re

Java program to find the sum of digit of a number and reverse it?

public SumRevInt(String args) { System.out.println("in constr"); if(args == null) { System.out.println("hello, enter a choice during execution"); } else { char

C plus plus program to find the sum of the digits using constructor?

Constructors cannot return values so the only paractical way ofachieving this would be to supply an output parameter to theconstructor. But what exectly are you constructing a

C program to find sum of digits of a number using function?

include #include void main() { int sumdig(int); int n,sum,d,f,rev=0; clrscr(); printf("enter the number"); scanf("%d",&n); sum=sumdig(n); printf("%d",sum)

Write a c program to find the sum of the five digits of a number?

To determine the value of the least-significant digit in a number,you divide by the base and take the remainder. To get the nextdigit, divide by the base and repeat. The follo