C Program To Find The Sum And Reverse Of A Number
by , 03-04-2011 at 12:47 PM (7014 Views)
Code:# include <stdio.h> # include <conio.h> main() { int n,m; int sum=0; int rev=0; clrscr(); printf("Enter 5 digit no"); scanf("%d",&n); while(n>0) { m = n%10; sum+=m; rev=rev*10+m; n=n/10; } printf("The sum of the digits is :%d",sum); printf("the reverse of the no is %d",rev); getch(); }
Comments
Leave Comment







Email Blog Entry