HOW TO FIND OUT THE RREVERS OF A GIVEN DIGIT NUMBER IF IT
IS INPUT THROUGH THE KEYBORD BY USING C LANGUAGE
Answers were Sorted based on User's Feedback
Answer / prof.gagandeep jagdev
#include<stdio.h>
#include<conio.h>
long int num,result=0,i;
void main()
{
clrscr();
printf("\nenter the number to be reversed=");
scanf("%ld",&num);
while(num>0)
{
i=num%10;
num=num/10;
result=result*10+i;
}
printf("\nReversed number is=%ld",result);
getch();
}
Is This Answer Correct ? | 4 Yes | 1 No |
Answer / yogita
#include<stdio.h>
void main()
{
int n;
printf("enter any number");
scanf("%d",&n);
while(n>0)
{
a=n%10;
n=n/10;
pritnf("%d",a);
}
getch();
}
Is This Answer Correct ? | 5 Yes | 3 No |
Answer / audumbar
#include<stdio.h>
main()
{
int n;
printf("\n enter the number");
scanf("%d",&n);
while(n!=0)
{
int a=n%10;
printf("%d",a);
n=n/10;
}
}
Is This Answer Correct ? | 1 Yes | 0 No |
What is function prototype in c language?
how to find out the reverse number of a digit if it is input through the keyboard?
what is the difference between malloc() and calloc() function?
int main(){ float f=8.0; if(f==8.0) printf("good"); else printf("bad"); } what is the answere and explain it?
how can i sort numbers from ascending order and descending order using turbo c..
What does calloc stand for?
Write a program to find factorial of a number using recursive function.
how to swap 2 numbers within a single statement?
Is main() function predfined or userdefined?
The differences between Windows XP and Windows Visa
When should you not use a type cast?
#include main() { int i=1,j=2; switch(i) { case 1: printf("GOOD"); break; case j: printf("BAD"); break; } }