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
#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); }
How do I get an accurate error status return from system on ms-dos?
What are the preprocessor categories?
How do you use a pointer to a function?
Explain how can you be sure that a program follows the ansi c standard?
What is atoi and atof in c?
What is #include called?
What is calloc malloc realloc in c?
What is data types?
Multiply an Integer Number by 2 Without Using Multiplication Operator
Explain what is the difference between #include and #include 'file' ?
how could explain about job profile
What is indirection in c?
What are the Advantages of using macro
Explain how do you sort filenames in a directory?