#include
#include
void main()
{int i,n,r,sum=0;
clrscr();
printf(“\n\n enter a number: “);
scanf(“%d”,&n);
for(i=1;i<=3;i++)
{
r=n%10;
sum=sum+r;
n=n%10;
}
printf(“\n\n\a\tThe sum is :%d”,sum);
getch();
}
o/p→
enter a number : 123
The sum is : 6
Everyone Is Equal In Front Of Tecinology
Hello Friends,
I am writing the programs for you.
Start noting from bottom to top.
Visit
0 comments:
Post a Comment
If you have any proble fee free to ask it here