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

Explain how can a program be made to print the name of a source file where an error occurs?

1134


What is the use of pointers in C?

1024


What are the advantages of using linked list for tree construction?

1024


What are the types of variables in c?

979


How do you list a file’s date and time?

1021


What does c mean in standard form?

1101


Why do we use & in c?

950


What are the application of void data type in c?

1133


Give a one-line C expression to test whether a number is a power of 2. [No loops allowed - it's a simple test.]

1021


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

1044


What is declaration and definition in c?

1015


How can I remove the leading spaces from a string?

1097


Write a program to reverse a string.

1025


What is c language and why we use it?

1003


What is the difference between declaring a variable by constant keyword and #define ing that variable?

3285