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
Can you please compare array with pointer?
I have written a pro*C program to fetch data from the cursor. where in i have used the concept of BULK FETCH.... each FETCH statement is taking lots of time to fetch specified number of rows at...
What are the advantages and disadvantages of a heap?
State the difference between x3 and x[3].
What is an arrays?
Do you know the use of fflush() function?
What happens if you free a pointer twice?
Is it possible to execute code even after the program exits the main() function?
how do you write a function that takes a variable number of arguments? What is the prototype of printf () function?
Explain the term printf() and scanf() used in c language?
How can I handle floating-point exceptions gracefully?
What is the general form of function in c?
What is meant by operator precedence?
What is the purpose of the following code? Is there any problem with the code? void send(int count, short *to, short *from) { /* count > 0 assumed */ register n = (count + 7) / 8; switch (count % 8) { case 0: do { *to = *from++; case 7: *to = *from++; case 6: *to = *from++; case 5: *to = *from++; case 4: *to = *from++; case 3: *to = *from++; case 2: *to = *from++; case 1: *to = *from++; } while (--n > 0); } }
Write a program to check palindrome number in c programming?