+ 8
How to print the following pattern in C or C++?
ABCDEDCBA ABCD DCBA ABC CBA AB BA A A Please try to confine only to C or C++
1 Answer
+ 8
Is this a challenge or a question ?
Well if its a question then try using matrix try this case for printing the triangle
cin>>sz;
for(i=0;i<sz;i++) {
for(j=0;j<sz;j++) {
if(i==j&&I+j==sz-1) {
cout<<mat[i][j]<<" ";
}
else {
cout<<" "<<" ";
}
}
cout<<endl;
}