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

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

650


What is void main () in c?

725


What does nil mean in c?

669


What is restrict keyword in c?

643


What is binary tree in c?

621






What does emoji p mean?

598


What do header files do?

603


Is int a keyword in c?

555


C program execution always begins with a) #include b) comment (/*-------*/) c) main() d) declaration instructions

608


What is hashing in c language?

613


Write a program to print “hello world” without using semicolon?

672


How can I insert or delete a line (or record) in the middle of a file?

574


Explain the difference between getch() and getche() in c?

565


What is the meaning of ?

612


What is the use of bitwise operator?

686