loop

loops
Last edited on
1
2
3
4
5
6
7
8
9
10
11
12
#include <iostream>

int main(){
    double n = 2;
    int e = 8;
    double T = 1;

    for(int i=1; i<=e; i++){
        std::cout << T << std::endl;
        T*=n;
    }
}


PS. If this is a school question that you chose to get an easy answer, when in real life you need to program, you will utterly fail.
Last edited on
Thank you metulburr.
Do you know how to make all the numbers line up horizontally instead of vertically?
remove std::endl from the output
Thank you.
Last edited on
on its last iteration change its output to suit the way you want it
what do you mean?
Last edited on
Thank you metulburr.
Topic archived. No new replies allowed.