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



HOW TO FIND OUT THE RREVERS OF A GIVEN DIGIT NUMBER IF IT IS INPUT THROUGH THE KEYBORD BY USING C ..

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

HOW TO FIND OUT THE RREVERS OF A GIVEN DIGIT NUMBER IF IT IS INPUT THROUGH THE KEYBORD BY USING C ..

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

HOW TO FIND OUT THE RREVERS OF A GIVEN DIGIT NUMBER IF IT IS INPUT THROUGH THE KEYBORD BY USING C ..

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

Post New Answer

More C Interview Questions

Why do some versions of toupper act strangely if given an upper-case letter?

0 Answers  


Should I learn data structures in c or python?

0 Answers  


I have seen function declarations that look like this

0 Answers  


Should I learn c before c++?

0 Answers  


which one is not preprocessor directive a)#if b)#elif c)#undef d)#pragma

16 Answers   Accenture, Infosys, TCS, Wipro,






Write c-code for 5+55+555+5555+55555+555555+5555555. Output will be it's answer...

4 Answers   TCS,


what is the difference between #include<> and #include”…”?

5 Answers  


What does sizeof int return?

0 Answers  


how to connect oracle in C/C++.

3 Answers   TCS, Wipro,


What is the benefit of using const for declaring constants?

0 Answers  


Explain what is a program flowchart and explain how does it help in writing a program?

0 Answers  


how do you programme Carrier Sense Multiple Access

0 Answers  


Categories