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...

convert 12345 to 54321 withoutusing strig

Answer Posted / mani bhowmik

void main()
{
int num, temp;
for(;;) {
printf("Enter number:");
scanf("%d",&num);
if(num == 0) break;
while(num) {
temp = num%10;
num = num/10;
printf("%d", temp);
}
printf("\n");
}
getche();
}
So any number will be reversed here. 12345 is five digit
number. Using while we can generalize the number of digits.
The continuous loop is ended when 0 is entered.

Is This Answer Correct ?    1 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do you mean by Recursion Function?

1106


Explain how do you list a file’s date and time?

1024


What is a far pointer in c?

1031


How can you tell whether a program was compiled using c versus c++?

1089


What is the general form of a C program?

1011


in ‘C’ language for Matrix Multiplication fails” Introspect the causes for its failure and write down the possible reasons for its failure.

8030


What is structure data type in c?

1006


What is the difference between formatted&unformatted i/o functions?

1044


How many levels deep can include files be nested?

1128


What is the difference between text and binary i/o?

1035


Explain with the aid of an example why arrays of structures don’t provide an efficient representation when it comes to adding and deleting records internal to the array.

3131


What is the advantage of a random access file?

1186


What is structure padding in c?

1114


string reverse using recursion

2442


What is the difference between array and pointer?

991