Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

how to find out the reverse number of a digit if it is
input through the keyboard?

Answer Posted / haris

Try it. It will seriously work. You would appreciate it.


#include<stdio.h>
#include<conio.h>

int main()

{
int x;
int a,b,c,d,e,f,g,h,i;
int sum;

printf("Please enter a five digit number:\n");
scanf("%d",&x);

a=x%10;
b=(x/10)% 10;
c=(x/100)% 10;
d=(x/1000)%10;
e=(x/10000)%10;
f=a*10000;
g=b*1000;
h=c*100;
i=d*10;


sum=f+g+h+i+e;

printf("\n\nThe sum of all digits is %d.",sum);

getch();
return 0;

}

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can I generate floating-point random numbers?

1140


#define f(g,h) g##h main O int i=0 int var=100 ; print f ("%d"f(var,10));} wat would be the output??

1960


What type is sizeof?

1048


"%u" unsigned integer print the a) address of variable b) value of variable c) name of a variable d) none of the above

1033


What is main function in c?

1091


What is the right type to use for boolean values in c? Is there a standard type? Should I use #defines or enums for the true and false values?

1067


What is a string?

1127


What are the different types of constants?

1082


Why c is faster than c++?

1051


How do we print only part of a string in c?

1034


How do you search data in a data file using random access method?

1315


What is wrong with this program statement?

1048


Can you pass an entire structure to functions?

1133


What’s the special use of UNIONS?

1157


cavium networks written test pattern ..

4089