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 the purpose of void in c?

0 Answers  


ATM machine and railway reservation class/object diagram

0 Answers   Zycus Infotech,


What is the use of typedef in c?

0 Answers  


What is quick sort in c?

0 Answers  


What is unary operator?

0 Answers  


What is bash c?

0 Answers  


Diff: between this 2 classes in terms of memory class A { int i; char c; double d; }; class A { double d; int i; char c; }; How it is calculating?

1 Answers   HCL,


What is spark map function?

0 Answers  


What are header files and explain what are its uses in c programming?

0 Answers  


can u give me the good and very optimised code for a car racing game?

0 Answers  


How can type-insensitive macros be created?

0 Answers  


Develop a flow chart and write a c program to find the roots of a quadratic equation ax2+bx+c=0 using switch and break statement.

1 Answers   TCS,


Categories