//WAP TO INPUT A 3-DIGIT NO. AND CALCULATE SUM OF ALL DIGITS.
#include<stdio.h>
#include<conio.h>
void main()
{
int num;
int r,sum=0;
clrscr();
printf("\nEnter a 3-digit
no.=");
scanf("%d",&num);
r=num%10;
sum=sum+r;
num=num/10;
r=num%10;
sum=sum+r;
num=num/10;
r=num%10;
sum=sum+r;
printf("\n\nThe sum of all digits of
entered no.=%d",sum);
getch();
}