write a program to display reverse of a number using for
loop?

Answer Posted / rakesh ranjan

#include<conio.h>
#include<stdio.h>
main()
{
int x,n,i;
printf("entre the number");
scanf("%d",&n);
for(;n>0;)
{
x=n%10;
printf("%d",x);
n/=10;
}
getch();
}

Is This Answer Correct ?    15 Yes 9 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

int i[2], j; int *pi;i[0] = 1; i[1] = 5; pi = i; j = *pi + 1 + *(pi + 1)Value of j after execution of the above statements will be a) 7 b) 6 c) 4 d) pointer

642


An instruction which is analysed and acted upon by the processor prior to the compiler going its work a) directive b) constructive c) constant d) absolute mode

597


What is the 'named constructor idiom'?

629


Write a program to find factorial of a number using recursive function.

632


Why can arithmetic operations not be performed on void pointers?

582






#define MAX(x,y) (x) >(y)?(x):(y) main() { inti=10,j=5,k=0; k= MAX(i++,++j); printf("%d..%d..%d",i,j,k); }

773


how many types of operators are include in c language a) 4 b) 6 c) 8 d) 12

639


a single linked list consists of nodes a to z .print the nodes in reverse order from z to a using recursion

2325


Explain how does flowchart help in writing a program?

615


Explain what is the benefit of using const for declaring constants?

603


Is c procedural or object oriented?

566


How is = symbol different from == symbol in c programming?

602


What is the use of bitwise operator?

677


What is void main () in c?

722


How do you sort filenames in a directory?

697