i want to make a program in which we use input having four
digits(4321) and get output its reciprocal(1234).
Answer Posted / 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 View All Answers
When a c file is executed there are many files that are automatically opened what are they files?
Explain what is the best way to comment out a section of code that contains comments?
Can a pointer be null?
What happens if a header file is included twice?
Write a program to replace n bits from the position p of the bit representation of an inputted character x with the one's complement. Method invertBit takes 3 parameters x as input character, p as position and n as the number of positions from p. Replace n bits from pth position in 8 bit character x. Then return the characters by inverting the bits.
Explain how can you tell whether a program was compiled using c versus c++?
What is the 'named constructor idiom'?
1.int a=10; 2.int b=20; 3. //write here 4.b=30; Write code at line 3 so that when the value of b is changed variable a should automatically change with same value as b. 5.
Draw a diagram showing how the operating system relates to users, application programs, and the computer hardware ?
7-Given an index k, return the kth row of the Pascal's triangle. For example, when k = 3, the row is [1,3,3,1]. For reference look at the following standard pascal’s triangle.
What are comments and how do you insert it in a C program?
Explain #pragma statements.
Design a program which assigns values to the array temperature. The program should then display the array with appropriate column and row headings.
What is a const pointer in c?
What is static and auto variables in c?