|
|
|
#1 (permalink) | ||||||||||||||
|
Folding Fanatic
|
I'm stuck. I need to print the total for numbers in the range of 1-100 using the FOR/NEXT loop command. Any ideas?
__________________I just made a program to print a list of ten random numbers in the range of 1-100. The new program does not need random numbers but simply the sum of all numbers between 1 and 100. Quote:
|
||||||||||||||
|
|
|
|
#2 (permalink) | |||||||||||||
|
Every base is base 10
|
I don't know Qbasic, but heres the C code (should be similar for something this trivial)
Code:
int x=0, i;
for(i=1; i<=100; i++)
x+=i;
printf("%d\n", x);
|
|||||||||||||
|
|
|
|
#3 (permalink) | |||||||||
|
Chiefly Ignorant
|
Quote:
Code:
LET TOTAL = 0 Code:
LET TOTAL = TOTAL + INDEX
__________________
|
|||||||||
|
|
|
|
#4 (permalink) | ||||||||||||||
|
Folding Fanatic
|
Quote:
![]()
|
||||||||||||||
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
|
|