Home
TCS NQT
Programming
_C Program
_Command Line Args
_Pattern Problem
_Notes
_C MCQs
Placement Papers
_TCS
__TCS Ninja
__Coding Question
__Technical MCQ
__Interview Experience
_Persistant
_Capgemini
_AMCAT
_Youtube Videos
Interview Questions
_C Programming
_HR Questions
Sponsored Blog
About
Home
Sum of digits of number
C program to find sum of digits of given number
C program to find sum of digits of given number
#include<stdio.h>
int main( )
{
int n, i, sum=0;
printf("Enter the number");
scanf("%d",&n);
while(n>0)
{
i=n%10;
n=n/10;
sum=sum+i;
}
printf("sum is %d",sum);
return 0;
}
Post a Comment
0 Comments
Check Our Latest Video on YouTube
Like us on Facebook
Social Plugin
Total Pageviews
Popular Posts
Get Started with Data Science Foundations - Top Resources Coursera
March 28, 2020
Explore a New Career Path - Top Free Learning Resources | Coursera
March 26, 2020
Break Into the Gaming Industry - Top Free Resources | Coursera
March 25, 2020
Tags
Count Number of digits
Count Number of Words
fibonacci within range
largest and smallest of an array
Leap Year
lower case to upper case
Odd Even
Palindrome
Perfect Number
Prime Sum within range
Remove Consonants
Split Number into Digit
Square root of prime
Sum of digits of number
Sum of Prime no
Vowel into Uppercase
Recent in Recipes
Categories
Biggest among two
1
Binary To Decimal
1
Binary To Octal
1
Command Line argument In CodeBlocks
2
Count Number of digits
1
Decimal To Binary
1
factorial
2
Fahrenheit to Centigrade
1
fibonacci within range
1
GCD
2
HCF
2
largest among N
1
largest among three
1
largest and smallest of an array
1
Largest element of an array
1
Leap Year
1
lower case to upper case
1
Palindrome
4
Power of Number
1
Prime Sum within range
1
print number without using loops
1
Square root of prime
1
Strong Number
1
Sum of digits of number
3
Sum of Odd Number using scanf()
1
Sum of Prime no
2
Swap two numbers
1
to check Prime
1
Variable and Datatypes
1
without atoi()
1
0 Comments