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

#define PRINT(int) printf("int = %d ",int) main() {< BR> intx,y,z; x=03;y=02;z=01; PRINT(x^x); z<<=3;PRINT(x); y>>=3;PRINT(y); }

832


How do I get an accurate error status return from system on ms-dos?

746


What are the preprocessor categories?

715


How do you use a pointer to a function?

730


Explain how can you be sure that a program follows the ansi c standard?

959






What is atoi and atof in c?

709


What is #include called?

670


What is calloc malloc realloc in c?

688


What is data types?

719


Multiply an Integer Number by 2 Without Using Multiplication Operator

430


Explain what is the difference between #include and #include 'file' ?

671


how could explain about job profile

1541


What is indirection in c?

707


What are the Advantages of using macro

770


Explain how do you sort filenames in a directory?

710