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

You are currently raising funds on Kickstarter. If Answers users want to help Qblinks, where can they back you and what will they get in return?

View Full Interview
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

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)

C program to find sum of all elements of a matrix?

/* @Autor: MD moniruzzaman http://www.youngprogrammer.com */ #include #define maxn 5 int matrix[maxn][maxn] = { {1,2,3,3,4},{2,3,4,1,2},{ 4,5,6,7,8},{3,4,5,6,9},{4

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

Write a c program to find sum of array elements?

Arrays in programming languages can seem daunting at first. But, once the basic principles behind them are grasped, one can write and use them with a minimal of thought or con
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 '

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 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