Find the output of the following code :-
class Solution {
public:
void printTriangle(int n) {
for(int i = 1; i=n; i++){
for(int j =i; j0; j--){
if(j%2 == 1)
cout"1 ";
else
cout"0 ";
}
coutendl;
}

Posted on by