Loading
View RSS Feed

Goldsonam's Blog

C Program To Find The Sum And Reverse Of A Number

Rate this Entry
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();
}

Submit "C Program To Find The Sum And Reverse Of A Number" to Digg Submit "C Program To Find The Sum And Reverse Of A Number" to del.icio.us Submit "C Program To Find The Sum And Reverse Of A Number" to StumbleUpon Submit "C Program To Find The Sum And Reverse Of A Number" to Google

Updated 03-07-2011 at 06:32 PM by Harsh

Categories
C C++

Comments




Disclaimer: Users of techforum4u.com are responsible for ensuring that any material they post (article, blog posts, images or other mulitimedia content) does not violate or infringe upon the copyright, patent, trademark, or any personal or proprietary rights of any third party, and is posted with the permission of the owner of such rights.Anyone who violates these rules may have their access privileges removed without warning.