What would you like to do?

# Program in c language to find the sum of digits?

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!

# Program in c language to find sum of digits using recursion?

int Sum( int digits ){if(digits < 10) return digits;return digits%10 + Sum(digits/10);}

# Using the C or similar programming languages how can you find the sum of 2 big number?

There are big number libraries or (large number libraries) for computations like that.

# 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

# C program to find the sum of odd positioned digits and even positioned digits of a number seperately?

include #include main() { int n,s,r,t; clrscr(); printf("enter n"); scanf("%d",&n); s=0;t=0; while(n!=0) { r=n%10; { if(r%2!=0) t=t+r; if(r%2==0) s=s+r; } n=n/10; } printf

# 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

# Write a C plus plus program to find the sum of digits of a given number?

include int sum_digits(int num, int base=10) { int sum=0; while( num ) { sum+=num%base; num/=base; } return(sum); } int main() { int sum=sum_digits(42); // assert( sum==6);

# 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

# What is the program in C language to find average of the digits of a number?

viod main() { int a,b,c; float sum,avg; a=10; b=20; c=30; sum=a+b+c; avg=sum/3; print("\n Avg : "avg); }

# A program to find sum of digits repeatedly until a single digit is obtained?

include #include main() { int n,s=0,sum=0,i,d; printf("enter the number"); scanf("%d",&n); while(n>0) { d=n%10; s=s+d; n=n/10; } while(s>0) { i

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

include int sumOfDigit(int x){ int ans = 0; while(x>0){ ans += (x%10); x /= 10; } return ans; } int main(void){ printf("%d",sumOfDigit(12)); retu

# 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 digit of a given number?

for (digsum= 0; n!=0; digsum+=n%10, n/=10);

# How do you find the sum in c language?

include #include void main() { clrscr(); int a,b,sum; printf("Enter two nos."); scanf("%d%d",&a,&b); sum=a+b; printf("Sum is = %d",sum); getch(); }

# 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