i want to make a program in which we use input having four
digits(4321) and get output its reciprocal(1234).



i want to make a program in which we use input having four digits(4321) and get output its reciproc..

Answer / fcuker

#include <stdio.h>

int main() {
int x;
scanf("%d", &x);
while (x > 0) {
printf("%d", x % 10);
x = x / 10;
}
return 0;
}

Is This Answer Correct ?    7 Yes 0 No

Post New Answer

More C Interview Questions

What is union and structure in c?

0 Answers  


What is self-referential structure in c programming?

0 Answers  


int a=0,b=2; if (a=0) b=0; else b=*10; What is the value of b ?

6 Answers   TCS,


In the following code segment what will be the result of the function, value of x , value of y { unsigned int x=-1; int y; y = ~0; if(x == y) printf("same"); else printf("not same"); } a) same, MAXINT, -1 b) not same, MAXINT, -MAXINT c) same , MAXUNIT, -1 d) same, MAXUNIT, MAXUNIT e) not same, MAXINT, MAXUNIT

1 Answers   IBM,


What is meant by inheritance?

0 Answers  






Which node is more powerful and can handle local information processing or graphics processing?

0 Answers  


What is function definition in c?

0 Answers  


Write a c program using for loop in switch case?

1 Answers   Infosys,


How are pointers declared in c?

0 Answers  


Is c++ based on c?

0 Answers  


What is the significance of scope resolution operator?

0 Answers   Agilent, ZS Associates,


sir i got 146 correct question & i have also the advantage of height so will they consider my marks as 146+3=149.can any body tell me how they consider my height marks.

1 Answers  


Categories