Originally posted by: SNiPeRX
or would it be int order [1] [2]... ???
Originally posted by: SNiPeRX
no dont want to learn C++ its my elective.. hehe, im political science...
Originally posted by: SNiPeRX
hehe correct mind if i ask to more questions...
value=0
top=10
score=1
while (score <= top)
{
value = value + score;
WHAT GOES HERE
}
I want it to add up integers 1-10.. thanks for the help
Originally posted by: pillage2001
Originally posted by: SNiPeRX
hehe correct mind if i ask to more questions...
value=0
top=10
score=1
while (score <= top)
{
value = value + score;
score++ ;
}
I want it to add up integers 1-10.. thanks for the help
A for loop???
Originally posted by: xchangx
int value=0;
for (int x=0; x<=10; x++){value++;}
Originally posted by: SNiPeRX
hehe correct mind if i ask to more questions...
value=0
top=10
score=1
while (score <= top)
{
value = value + score;
WHAT GOES HERE
}
I want it to add up integers 1-10.. thanks for the help
Originally posted by: Cerb
Add up integers 1 to 10 cumulatively, to get 55 (1+2+3+4+5+6+7+8+9+10), as opposed to adding until they reach 10? If so...
int value = 0;
for( int i = 1; i <= 10; i++ ) { value += i; }