Sunday, November 28, 2010

Write a C program to print Addition of the given two decimal number

#include
main()
{
int n=0;
int sum=0;
printf("Enter the values of n\n");
scanf("%d",&n);
while (n>0)
{
sum=sum+n%10;
n=n/10;
}
printf("sum=%d\n",sum);
}