i forgot to put DO in my program. since i was instructed to use DO-WHILE LOOP. i still have the same output if i use this code. But better to have the DO inserted.
output:
0
0 2
0 2 4
0 2 4 6
0 2 4 6 8
0 2 4 6 8 10
#include <iostream.h>
#include<conio.h>
#include<stdio.h>
using namespace std;
int main()
{
int i=10;
int x=2;
int y=0;
while (x <= i)
{
y = 0;
while ( y <= x)
{
cout << y << " ";
y += 2;
}
cout <<endl;
x += 2;
}
return 0;