505,832 views
27 votes
27 votes
2

2 4
2 4 6
2 4 6 8
2 4 6 8 10
2 4 6 8 10 12 write the c programming input

User DisibioAaron
by
2.9k points

1 Answer

22 votes
22 votes

Hello, algorithm in C++ language of this problem has given below. If any question(s) then feel free to ask in comments!

Good luck!

#include <bits/stdc++.h>

int main(int argc, char* argv[]) {

for(int i=1;i<=7;i++) {

int x=2;

while(x!=2*i) {

std::cout << x << " ";

x+=2;

}

std::cout << std::endl;

}

return 0;

}

User LIJIN SAMUEL
by
2.9k points