Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

how to find out the reverse number of a digit if it is
input through the keyboard?

Answer Posted / 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 ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to set file pointer to beginning c?

1200


What are the advantages and disadvantages of c language?

1013


When can a far pointer be used?

1021


Why is it that not all header files are declared in every C program?

1212


Explain what is the difference between text files and binary files?

1150


What is string function c?

1016


In C programming, what command or code can be used to determine if a number of odd or even?

1049


How many types of functions are there in c?

1136


Explain what is a pragma?

1045


What are the different properties of variable number of arguments?

1152


What is the explanation for cyclic nature of data types in c?

1206


Why is c called c not d or e?

1096


What does %d do?

1271


What is identifier in c?

1009


how do you write a function that takes a variable number of arguments? What is the prototype of printf () function?

1932