to find out the reverse digit of a given number

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is data type long in c?

625


What are the restrictions of a modulus operator?

638


What is array within structure?

587


What are the usage of pointer in c?

703


What is the difference between declaring a variable and defining a variable?

724






how many errors in c explain deply

1631


How to declare a variable?

572


Why is event driven programming or procedural programming, better within specific scenario?

1955


What is local and global variable in c?

618


code for quick sort?

1622


Is c procedural or functional?

588


What is the purpose of main( ) in c language?

623


What are pointers? What are different types of pointers?

632


What is the difference between printf and scanf )?

597


write a program that reads lines(using getline), converts each line to an integer using atoi, and computes the average of all the numbers read. also compute the standard deviation.

1983