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

Is the below things valid & where it will be stored in memory layout ? static const volatile int i; register struct { } ; static register;

2 Answers   Bosch,


4-Take two sets of 5 numbers from user in two arrays. Sort array 1 in ascending and array 2 in descending order. Perform sorting by passing array to a function mySort(array, sortingOrder). Then multiply both the arrays returned from function, using metric multiplication technique in main. Print result in metric format.

0 Answers   TCS,


How to write a C program to determine the smallest among three nos using conditional operator?

2 Answers   Google,


int x=5; printf("%d%d%d",x,x<<2,x>>2);

2 Answers   TANCET,


How can I get Single byte from 'int' type variable? Can we alter single bit or multiple bits in int type variable? if so, How?

2 Answers  






why we are using float in C

4 Answers  


What is #include conio h?

0 Answers  


What are the types of type specifiers?

0 Answers  


What are the usage of pointer in c?

0 Answers  


int a=20; int b=30; int c=40; printf("%d%d%d"); what will be the output?

5 Answers   CMC,


Are local variables initialized to zero by default in c?

0 Answers  


Why doesn't the code "a[i] = i++;" work?

4 Answers  


Categories