please help me doing my assignmnet, I have to write a program using nested while loops which will show the ouput as follows
1
2 2
3 3 3
4 4 4 4
and using the same nested while loops a program that shows following output
1
2 3
4 5 6
7 8 9 10
#include <iostream>
using std::cout;
using std::endl;
int main(){
int
counter1=1,
counter2=1;
while(counter1<=4){
while(counter2<=counter1){
cout<<counter1;
counter2++;
}//end inner while
cout<<endl;
counter2=1;
counter1++;
}//end outer loop while
return 0; //indicates successful termination
}//end main
#include <iostream>
using std::cout;
using std::endl;
int main(){
int
counter1=1,
counter2=1,
counter3=0;
while(counter1<=4){
while(counter2<=counter1){
cout<<++counter3;
counter2++;
}//end inner while
cout<<endl;
counter2=1;
counter1++;
}//end outer loop while
return 0; //indicates successful termination
}//end main