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

# Your role has expanded so much since the show started, this season in particular we're starting to learn a lot more about Peter and why he is the way he is. How did you approach playing his character differently this season?

View Full Interview

# Write a program to find sum of two numbers in c language without using variables?

include"stdio.h" int main ( int argc, char *argv[ ] ) { if(argc == 2) printf("Sum of Two Numbers: %d \\r\\n", atoi( argv[1] ) + atoi( argv[2] ) ); else printf( "In-v (MORE)

# 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) (MORE)

# 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=s (MORE)
In HTML

# Clearing Up Whether or Not HTML Is a Programming Language

HTML, or "HyperText Markup Language," is often described as a programming language. Internet articles often categorize HTML with programming languages such as Python, Ruby and (MORE)

# Which Computer Programming Language Should You Learn?

If you pay attention to trends in education, you may have noticed that more and more students are learning some computer programming code earlier in their education. In fact, (MORE)

# Easy to Use Digital Drawing Programs

Digital drawing software provides you with all the tools you need to draw, paint or create graphics. Here are some of the best digital drawing programs available.SketchBook Pr (MORE)

# The Best Free Digital Photography Programs

Digital photography programs have made great advances in the past few years. It has gotten to the point where programs you download for free have so many features and tools th (MORE)
In Careers

# Taking a Close Look at Digital Forensics as a Career

A career in digital forensics might be just the right choice for a person who dreams of being a mad scientist while working on the right side of the law. A digital forensics e (MORE)

# Four of the Best Digital Notepads

The best digital notepad works on all of your devices, is the right price, has a simple interface and has all the options you need. There are many different digital notepads a (MORE)

# 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 (MORE)

# 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 (MORE)

# Write a java program to find out the sum of a number of n digits?

class Sum_Of_Digits { public static void printSumandnoofdigits(int n) { int temp = n; int count = 0; int sum = 0; while ( n > 0 ) { sum = sum + n % 10; n = (MORE)

# 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 (MORE)

# 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 (MORE)