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 would happen to X in this expression: X += 15; (assuming the value of X is 5)

0 Answers  


What does calloc stand for?

0 Answers  


Difference between constant pointer and pointer to a constant.

0 Answers   Huawei,


void swap(int a,int b) { a=a+b; b=a-b; a=a-b; } in this code always gives the same result for all case

9 Answers   Accenture, TCS,


How can I get the current date or time of day in a c program?

0 Answers  






What tq means in chat?

0 Answers  


Read two numbers from keyboard and find maximum of them?

1 Answers  


What is an example of enumeration?

1 Answers  


How to set file pointer to beginning c?

0 Answers  


What is static memory allocation? Explain

0 Answers  


What is the output for the program given below typedef enum grade{GOOD,BAD,WORST,}BAD; main() { BAD g1; g1=1; printf("%d",g1); }

4 Answers   ADITI,


Can we change the value of static variable in c?

0 Answers  


Categories