Aug 15, 2012 at 12:33pm UTC
Hey guys im doing some basic programming
using loop statements my target is to produce an output like this:
*****
****
***
**
*
but no luck? :(
here's my code:
#include<iostream.h>
char x;
main()
{
for(x=0;x<6;x++)
cout<<x;
return 0;
}
can you please help me? :(
Aug 15, 2012 at 12:46pm UTC
You need a second nested loop. one for top down, one for left right. for the next line use cout<<endl;
Last edited on Aug 15, 2012 at 12:46pm UTC
Aug 15, 2012 at 12:49pm UTC
Get a new compiler, one that's less than 5 years old!
Last edited on Aug 15, 2012 at 12:52pm UTC
Aug 15, 2012 at 12:54pm UTC
Thanks man finally got it right! :D
Aug 15, 2012 at 12:55pm UTC
Did you get my message? Get that right first!
Last edited on Aug 15, 2012 at 12:56pm UTC
Aug 15, 2012 at 1:00pm UTC
no. i was using this old c++ because of my assignment in my class
but i have the latest c++ in my computer :)
Aug 15, 2012 at 1:14pm UTC
And your school only has that old compiler?
Last edited on Aug 15, 2012 at 1:15pm UTC