PDA

View Full Version : vb.net incrementing asterisks problem


konjammenson
03-22-2005, 07:06 PM
i need to do a basic console app that prints out:

*
**
***
****
*****

heres the code i have thus far:

dim a, i as integer

for a = 1 to 5
for i = 1 + a
console.write("*)
next i
console.writeline()
next a

the problem i am having is that the (1 + a) part gets a squiggly under it and won't work. it seems logically correct but i can't figure out whats wrong.

konjammenson
03-22-2005, 07:09 PM
ok, nvm i figured it out

changed the (for i = 1 + a) to (for i = 1 to a)

and now it works beatifully! yay!!