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 .

Program in c language to find the sum of digits?
#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);
}
}
7 people found this useful
Thanks for the feedback!
Follow

What advice would you give to any hopeful artists who are still looking for their big break?

View Full Interview

Write a C program to find sum of 2 matrices?

void main()  { int arr1[3][3],arr2[3][3]; int i,j; for(i=0;i
C program to find sum of two sparse matrices?

C program to find sum of two sparse matrices?

 #include  #include    typedef struct node  {  int column;  int value;  int row; 

Write c program to find sum of two numbers?

/*use "c-free" compiler*/ #include main() { int a,b,c; printf("enter the value of a & b"); scanf("%d%d",&a,&b); c=a+b; printf("sum of the two numbers is a+b- %d",c); g

Write a c program to compute the sum of digits of a given integer number?

int sumDigits(int n) {   int sum = 0;    while( n > 0 ) {   sum += (n % 10); // add last digit of n to sum   n /= 10; // divide n by 10 to "chop off" the la
C program to find sum of n numbers?

C program to find sum of n numbers?

include #include main() { int num, n,sum=0,i=0; printf("enter the number of elements to be added "); scanf("%d",&n); printf("enter %d numbers",n); while(i

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 java script program to find sum of the digits of a given integer?

import java.util.*;   class SumOfDigits {  public static void main(String args[]) {  int sum = 0;  System.out.println("Enter
C program to find the sum of the digits of a number?

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+rem; n
C program to find the sum of odd positioned digits and even positioned digits of a number seperately?

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("s
Program to find sum of two numbers in VB.NET language?

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 '

Write a program to find the sum of the digits and reverse of the digits using inheritance?

There is a far easier way to implement the required functionality than using inheritance. However, to answer the question, here's one possible solution that makes use of inher