Write a program that prints at least 10 characters of your name (last, first) in uppercase at the terminal. Use a n by m array (i.e., a two dimensional array, with n (=7) as size of the first dimension and m (=10) as the second dimension) to represent each oversize letter. C++, the name is "Krish"
Write a
in uppercase at the terminal. Use a n by m array (i.e., a two dimensional array, with n (=7) as size of
the first dimension and m (=10) as the second dimension) to represent each oversize letter. C++, the name is "Krish"
The source code of the program
#include <iostream>
using namespace std;
const int ROWS = 7;
const int COLS = 10;
char name[ROWS][COLS] = {
{'#', ' ', ' ', '#', '#', '#', ' ', ' ', '#', ' '},
{'#', ' ', ' ', ' ', ' ', ' ', '#', ' ', '#', ' '},
{'#', ' ', ' ', ' ', ' ', ' ', '#', ' ', '#', ' '},
{'#', '#', '#', ' ', ' ', ' ', '#', ' ', '#', ' '},
{'#', ' ', ' ', ' ', ' ', ' ', '#', ' ', '#', ' '},
{'#', ' ', ' ', ' ', ' ', ' ', '#', ' ', '#', ' '},
{'#', ' ', ' ', '#', '#', '#', ' ', ' ', '#', ' '}
};
int main() {
for (int i = 0; i < ROWS; i++) {
for (int j = 0; j < COLS; j++) {
cout << name[i][j];
}
cout << endl;
}
return 0;
}
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images