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
Explain what is wrong in this statement?
Is it possible to pass an entire structure to functions?
Explain the use of 'auto' keyword
Is c easier than java?
What is clrscr ()?
How are 16- and 32-bit numbers stored?
What is c method?
What is the use of bitwise operator?
Given below are three different ways to print the character for ASCII code 88. Which is the correct way1) char c = 88; cout << c << " ";2) cout.put(88);3) cout << char(88) << " "; a) 1 b) 2 c) 3 d) constant
What does char * * argv mean in c?
Can we compile a program without main() function?
What is assignment operator?
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.
how is the examination pattern?
When should a far pointer be used?