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 |
Hi, main() { } Is a user defined function or Built in Functionn
#include<stdio.h> int main(){ int a[]={1,2,3,5,1}; int *ptr=a+4; int y=ptr-a; printf("%d",y); }
What is 1d array in c?
how 2 compile & execute c program with out using editor?
What are shell structures used for?
Rapunzel walks into the forest of forgetfullness. She meets a Lion who lies on Monday Tuesdays and Wednesdays and meets a rabbit who lies on Thurs fridays and saturdays . On that day both say that "I lied yesterday". What day is it .
What is c value paradox explain?
accept character from keyboard untill the user presses the enter key.If the user enters any character other than upper case(A-Z)alphabets program should stop taking any input
What is meant by recursion?
List out few of the applications that make use of Multilinked Structures?
how to find your architecture is LittleEndian or BigEndian?
How many types of errors are there in c language? Explain