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 |
Why do some versions of toupper act strangely if given an upper-case letter?
Should I learn data structures in c or python?
I have seen function declarations that look like this
Should I learn c before c++?
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...
what is the difference between #include<> and #include”…”?
What does sizeof int return?
how to connect oracle in C/C++.
What is the benefit of using const for declaring constants?
Explain what is a program flowchart and explain how does it help in writing a program?
how do you programme Carrier Sense Multiple Access