void rev (int n)
{
putchar ('0'+n%10);
n/=10;
if (n) rev (n);
}
Use Simply Recursion.. :)
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.
What code.
int youArray[arraysize] = {...};...for (int i = 1; i
Main(include.h)
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.
the multiplication of the number of iterations with the number of statements in that loop is equal to loop length.
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.
unsigned reverse (unsigned num) { unsigned rev = 0; while (num) { rev *= 10; rev += num % 10; num /= 10; } return rev; }
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.
with command `mplayer -loop number-of-repeatsfilename`if number-of-repeats is set to 0, the movie would loop for ever.
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.
with a loop. len= strlen (s); p= s; q= s+len-1; while (p<q) { (swap) ++p; --q; }