/* Program sum of digit */
#include<stdio.h>
#include<conio.h>
void main()
{
int n,digit, n1,sum=0;
clrscr();
printf(“Enter the Any Integer No: “);
scanf(“%d”,&n);
n1=n;
while(n!=0)
{
digit = n%10;
sum+= digit;
n/=10;
}
printf(“number is = %d :\n”,n1);
printf(“Sum of digit = %d :”,sum);
getch();
}
Latest posts by Mohit Arora (see all)
- MongoDB Operators Tutorial – What are Different Operators Available? - October 5, 2019
- MongoDB Projection Tutorial : Return Specific Fields From Query - March 9, 2019
- MongoDB Index Tutorial – Create Index & MongoDB Index Types - July 6, 2018