Program to add individual digits of a number Post author:admin Post published:July 30, 2018 Post category:C Programms Post comments:0 Comments #include<stdio.h> #include<conio.h> void main() { long int a,n,sum=0; clrscr(); printf(“enter any number”); scanf(“%lld”,&n); while(n>0) { a=n%10; // storing the remainder sum=sum+a; n=n/10; } printf(“%lld”,sum); getch(); } Output: Tags: adding individual digits of a number You Might Also Like Switch Program in C July 29, 2018 Program to swap two numbers without using third variable August 4, 2018 Bubble Sort program in C July 29, 2018 Leave a Reply Cancel replyCommentEnter your name or username to comment Enter your email address to comment Enter your website URL (optional) Save my name, email, and website in this browser for the next time I comment.