Question

V

Venkat

Hi All,

I have the following problem please help me in solving this.

#include <stdafx>
main()
{
int i, n=20;
for(i=0;i<n; i--)
{
printf(i);
}

Only one character in the above needs to be modified such that the character
'-' will be printed 20 times.
People say there are 3 ways of doing it but i could figure out only one way
given below.

#include <stdafx>
main()
{
int i, n=20;
for(i=0;i<n; n--)
{
printf(i);
}

Can someone crack the other 2 possibilities.


regards,
Venkat
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top