3 E i=1 (4 E j=1 (i+j))
3 is number on top
i=1 is number on bottom
then the entire other loop is that thing you gotta get
How would I do that in C++?
Thanks.
3 E i=1 (4 E j=1 (i+j))
3 is number on top
i=1 is number on bottom
then the entire other loop is that thing you gotta get
How would I do that in C++?
Thanks.
I have no idea what you're asking, but you put a for loop inside a for loop like this:
Code:for(i = value; i < anotherValue; i++) { for(e = value; e < anotherValue; e++) { //do stuff } }
I tried this:
for(i=1; i<=3
{
for(j=1; j<=4; (i+j))
{
cout<<i<<endl;
}
}
but it keeps scrolling down 1's when I execute it...any more suggestions?
you need to update j in the second loop. (i+j) doesn't do anything, try j += i . you also need to update i in the first loop.
for(i=1; i<=3; i++)
{
for(j=1; j<=4; j+=i)
{
cout<<i<<endl;
}
}
Thanks!