answersLogoWhite

0

void rev (int n)

{

putchar ('0'+n%10);

n/=10;

if (n) rev (n);

}

Use Simply Recursion.. :)

User Avatar

Wiki User

14y ago

What else can I help you with?

Related Questions

What is a balloon loop?

A balloon loop is a looped section of railway track which allows a rail vehicle or train to reverse direction without having to shunt or stop.


How reverse loop works in this code?

What code.


How to print the reverse of an array without using backward loop?

int youArray[arraysize] = {...};...for (int i = 1; i


Wap to calculate reverse of a number without loops?

Main(include.h)


String reverse program with single string and without using library functions in java?

You can create a separate string initially empty. Then using a loop, start at the end of the string and add it to the end of the other string. At the end of the loop, the other string would contain the reverse.


How do you calculate loop length?

the multiplication of the number of iterations with the number of statements in that loop is equal to loop length.


What is the time complexity of using a while loop inside a for loop?

The time complexity of using a while loop inside a for loop is O(nm), where n is the number of iterations of the for loop and m is the number of iterations of the while loop.


How do you write a C program to reverse the 3 digits of a number using while loop?

unsigned reverse (unsigned num) { unsigned rev = 0; while (num) { rev *= 10; rev += num % 10; num /= 10; } return rev; }


How do you reverse a given string without using string functions?

1.take while loop in which u continue up to null in array of string. 2.once u get null pointer then take a new array of same length. 3.when u get null there ll save position no in variable i. 4.take while loop i to 0; 5.and j=0 for new array. 6.in above loop copy old array to new array in each cycle of loop. 7.j++; 8.u ll get reverse of string.


How execute a movie in loop through mplayer?

with command `mplayer -loop number-of-repeatsfilename`if number-of-repeats is set to 0, the movie would loop for ever.


How can you define null statement in loop in C programming?

If you are using for loop for(;;); or you can also define condition and iterations but the loop has to close there itself without any statement inside it. In the similar way you can define while and do while loop without any statement.


How To find reverse of string without using strrev function with code?

with a loop. len= strlen (s); p= s; q= s+len-1; while (p<q) { (swap) ++p; --q; }