0

Help me out for this plzz

ABCDDCBA ABCCBA ABBA AA

19th Nov 2016, 5:43 PM
Urvish Bundela
Urvish Bundela - avatar
3 Answers
+ 1
char array[4] = { A, B, C, D} for (I = 3; I >= 0 ; I--) { for (x = 0; x < I ; x++) { cout << array[ x ]; } for (x = 0; x < I ; x++) { cout << array[3 - x ]; } cout << endl
19th Nov 2016, 8:15 PM
Daniel Carmel
Daniel Carmel - avatar
+ 1
I'm not sure if this will work but it worth trying
19th Nov 2016, 8:15 PM
Daniel Carmel
Daniel Carmel - avatar
+ 1
#include <iostream> using namespace std; int main() { for (int i = 3; i >= 0; i--) { for (char c = 65; c <= 65 + i; c++) cout << c; for (char c = 65 + i; c >= 65; c--) cout << c; cout << "\n"; for (int j = 4; j > i; j--) cout << " "; } return 0; }
19th Nov 2016, 11:37 PM
Cohen Creber
Cohen Creber - avatar