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
a direct address that identifies a location by means of its displacement from a base address or segment a) absolute address b) relative address c) relative mode d) absolute mode
What is void main () in c?
What does nil mean in c?
What is restrict keyword in c?
What is binary tree in c?
What does emoji p mean?
What do header files do?
Is int a keyword in c?
C program execution always begins with a) #include b) comment (/*-------*/) c) main() d) declaration instructions
What is hashing in c language?
Write a program to print “hello world” without using semicolon?
How can I insert or delete a line (or record) in the middle of a file?
Explain the difference between getch() and getche() in c?
What is the meaning of ?
What is the use of bitwise operator?