write a program to display reverse of a number using for
loop?
Answer Posted / narendra
It is simple.use this and it works
#include <stdio.h>
#include <conio.h>
int main()
{
int rem,num;
clrscr();
printf("Enter the number\n");
scanf("%d",&num);
for (num= num; num > 0; num = num/10)
{
rem = num % 10;
printf("%d",rem);
}
return 0;
}
| Is This Answer Correct ? | 14 Yes | 11 No |
Post New Answer View All Answers
What are the types of type qualifiers in c?
By using C language input a date into it and if it is right?
What is difference between structure and union with example?
What is dynamic memory allocation?
any limit on the number of functions that might be present in a C program a) max 35 functions b) max 50 functions c) no limit d) none of the above
How can I recover the file name given an open stream?
Why structure is used in c?
What does int main () mean?
Explain the priority queues?
What is the right type to use for boolean values in c? Is there a standard type? Should I use #defines or enums for the true and false values?
Explain main function in c?
What are different types of variables in c?
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.
If null and 0 are equivalent as null pointer constants, which should I use?
Is a house a mass structure?