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


Please Help Members By Posting Answers For Below Questions

what is event driven software and what is procedural driven software?

2017


What are the types of data structures in c?

604


In a switch statement, what will happen if a break statement is omitted?

604


What does #pragma once mean?

690


Explain the meaning of keyword 'extern' in a function declaration.

726






How do you construct an increment statement or decrement statement in C?

746


What is the purpose of the preprocessor directive error?

683


Difference between pass by reference and pass by value?

659


How can type-insensitive macros be created?

701


What is static memory allocation? Explain

632


Can we replace the struct function in tree syntax with a union?

782


Explain how can I pad a string to a known length?

655


Explain what is the purpose of "extern" keyword in a function declaration?

623


write a program to reverse a every alternetive words in a string in a place. EX: Input is "this is the line of text" Output should be "shit is eht line fo text" Please any one tell me code for that.

1579


Why header file is used in c?

577