-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAssignment15_3.c
50 lines (48 loc) · 969 Bytes
/
Assignment15_3.c
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
45
46
47
48
49
50
#include<stdio.h>
void Pattern(int iRow, int iCol)
{
int i=0,j=0;
if(iRow!=iCol)
{
printf("number of rows and columns should same\n");
return;
}
for(i=1;i<=iRow;i++)
{
for(j=1;j<=iCol;j++)
{
if(i==j)
{
printf("$\t");
}
else if(i>j)
{
printf("#\t");
}
else
{
printf("*\t");
}
}
printf("\n");
}
printf("\n");
}
int main()
{
int iValue1 = 0, iValue2 = 0;
printf("Enter number of rows and columns");
scanf("%d %d",&iValue1, &iValue2);
Pattern(iValue1, iValue2);
return 0;
}
/*output:-
* Enter number of rows and columns5
5
$ * * * *
# $ * * *
# # $ * *
# # # $ *
# # # # $
user@user-Lenovo-G50-80:~/Desktop/LB/Assignments/Assignment 15$
*/