adspace


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


Please Help Members By Posting Answers For Below Questions

Do you know the difference between malloc() and calloc() function?

1133


Explain the difference between null pointer and void pointer.

1157


what is ur strangth & weekness

2589


Can a function be forced to be inline? Also, give a comparison between inline function and the C macro?

1181


Is int a keyword in c?

1057


what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;

2737


write a program to find out prime number using sieve case?

2174


what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;

2515


In C language, the variables NAME, name, and Name are all the same. TRUE or FALSE?

1295


can any one please explain, how can i access hard disk(physical address)? it is possible by the use of far,near or huge pointer? if yes then please explain......

2003


ATM machine and railway reservation class/object diagram

5335


How can I implement sets or arrays of bits?

1117


The % symbol has a special use in a printf statement. How would you place this character as part of the output on the screen?

1358


In C programming, how do you insert quote characters (‘ and “) into the output screen?

1616


swap 2 numbers without using third variable?

1210