to find out the reverse digit of a given number
Answers were Sorted based on User's Feedback
Answer / vishnu
#include<stdio.h>
#include<conio.h>
void main()
{
int r,num,sum=0;
clrscr();
printf("Enter any Digit \n");
scanf("%d", &num);
while(num!=0)
{
r=num%10;
sum=sum*10+r;
num=num/10;
}
printf("Reverse Digit of a given number = %d",sum);
getch();
}
Is This Answer Correct ? | 66 Yes | 26 No |
Answer / vignesh1988i
#include<stdio.h>
#include<conio.h>
void main()
{
int n,a;
printf("enter the number to be reversed :");
scanf("%d",&n);
printf("the reversed number is :");
for(int i=0;n>0;i++)
{
a=n%10;
n=n/10;
printf("%d",a);
}
getch();
}
Is This Answer Correct ? | 74 Yes | 37 No |
Answer / vaibhav
#include<stdio.h>
#include<conio.h>
void main()
{
int no, t;
clrscr();
printf("\nenter the no.");
scanf("%d",&no);
while(no!=0)
{
t=no%10;
no=no/10;
printf("%d",t);
}
getch();
}
Is This Answer Correct ? | 23 Yes | 9 No |
Answer / jet lee
#include<stdio.h>
int rev(int y);
int main()
{
int x;
printf("\n please enter the number:\n");
scanf("%d",&x);
rev(x);
return 0;
}
int rev(int y)
{
int i;
do
{
i=(y%10);
printf("%d",i);
y=(y/10);
}while(y>0);
}
Is This Answer Correct ? | 17 Yes | 9 No |
Answer / srinath, hyd
#include<stdio.h>
#include<conio.h>
void main()
{
int no, t;
clrscr();
printf("\nenter the no.");
scanf("%d",&no);
while(no!=0)
{
t=no%10;
no=no/10;
printf("%d",t);
}
getch();
}
Is This Answer Correct ? | 10 Yes | 11 No |
Answer / sreejesh1987
int rev(int,int);
void main()
{
int a,b;
clrscr();
printf("\nEnter the number to reverse:");//456
scanf("%d",&a);
b=a%10;//b=6
printf("\nReverse of the number is: %d",rev(a,b));
getch();
}
int rev(int a,int b)
{
if(a>9)//456
{
a=a/10;//a=45
b=b*10+a%10;//65
return rev(a,b);
}
else
return b;
}
Is This Answer Correct ? | 3 Yes | 5 No |
Explain the difference between structs and unions in c?
5) Write a program that takes a 3 digit number n and finds out whether the number 2^n + 1 is prime, or if it is not prime find out its factors.without using big int and exponential function
design and implement a program that reads floating-points numbers in a sentinel-controlled loop until the user terminates the program by entering zero.your program should determinate and print the smallest,largest and average of the supplied numbers.
Explain output of printf("Hello World"-'A'+'B'); ?
What is pointer to pointer in c language?
How can I sort more data than will fit in memory?
What compilation do?
7 Answers Geometric Software, Infosys,
what is the difference between call by value and call by reference?
5 Answers Genpact, Global Logic, Infosys,
What does the message "automatic aggregate intialization is an ansi feature" mean?
What is meant by 'bit masking'?
What is the difference between char array and char pointer?
What is logical error?