-
Notifications
You must be signed in to change notification settings - Fork 0
/
pattern1.cpp
47 lines (38 loc) · 898 Bytes
/
pattern1.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*Lecture 4.1: Awesome Pattern Question-1 */
/* Question 1: Rectangle Pattern ********
********
********
********
********
Rows: 5
column: 8
for(int i=0; i<=rows; i++) {
cout<<"*"<<endl;
}
How many times we have to write cout statement. So we are using nested for loop,
*/
#include<iostream>
using namespace std;
int main() {
int row, col;
cout<<"Enter the Row: ";
cin>>row;
cout<<"Enter the Column: ";
cin>>col;
//add for loop here, jitna row user humko dia hai
//for rows
for (int i=1; i<=row; i++) {
//for column
for(int j=1; j<=col; j++) {
cout<<"*";
}
cout<<endl;
}
return 0;
}
/*Output:
*****
*****
*****
*****
*/