+ 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++

1st Nov 2017, 12:42 PM
Abhishek Tandon
Abhishek Tandon - avatar
1 Respuesta
+ 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; }
1st Nov 2017, 1:36 PM
RZK 022
RZK 022 - avatar