Write a program that will display the following pattern, given the value of n and m. Example if n = 5,and m=6, output
#include <iostream>
using namespace std;
int main()
{
int n, m;
cout << "Enter N = ";
cin >> n;
cout << "Enter M = ";
cin >> m;
for (int i = 0; i < m; i++)
{
for (int j = 0; j < n; j++)
cout << "*";
cout << endl;
}
return 0;
}
Comments
Leave a comment