#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int a,b,c,d,e,f;
cout<<“Enter the three digit no. “;
cin>>a;
b=a%10;
c=a/10;
d=c%10;
e=a/100;
f=b+d+e;
cout<<“Sum of the digits = “<<f;
getch();
}
#include<conio.h>
void main()
{
clrscr();
int a,b,c,d,e,f;
cout<<“Enter the three digit no. “;
cin>>a;
b=a%10;
c=a/10;
d=c%10;
e=a/100;
f=b+d+e;
cout<<“Sum of the digits = “<<f;
getch();
}
No comments:
Post a Comment