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
What do header files do?
How can I read and write comma-delimited text?
What is a scope resolution operator in c?
Please send me WIPRO technical question to my mail ID.. its nisha_g28@yahoo.com please its urgent
How can I read data from data files with particular formats?
write a c program to print the next of a particular no without using the arithmetic operator or looping statements?
Difference between Shallow copy and Deep copy?
What is the difference between struct and union in C?
Explain pointer. What are function pointers in C?
What is s or c?
Is c still used?
a) Identify the following declarations. Ex. int i (integer variable) float a[l0](array of 10 real nos) int (*f())() void *f int (*f()) [] void *f int f[] [] [] char *(*f) () int (*f[]) [] float(*f) [] [] float **f int ******f
How do we make a global variable accessible across files? Explain the extern keyword?
Write a c program to build a heap method using Pointer to function and pointer to structure ?
the question is that what you have been doing all these periods (one year gap)