-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path102Pattern.c
More file actions
55 lines (45 loc) · 933 Bytes
/
102Pattern.c
File metadata and controls
55 lines (45 loc) · 933 Bytes
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
51
52
53
54
55
/*
Row = 6
Col = 6
$ $ $ $ $ $
$ $ * * * $
$ * $ * * $
$ * * $ * $
$ * * * $ $
$ $ $ $ $ $
*/
#include<stdio.h>
void Display(int iRow, int iCol)
{
int i = 0, j = 0;
if(iRow != iCol)
{
printf("Row number and column number are different\n");
return;
}
for(i=1; i<=iRow; i++)
{
for(j=1; j<=iRow; j++)
{
if((i == 1) || (i == iRow) || (j == 1) || (j == iCol) || (i == j))
{
printf("$\t");
}
else
{
printf(" \t");
}
}
printf("\n");
}
}
int main()
{
int iValue1 = 0, iValue2 = 0;
printf("Enter number of rows\n");
scanf("%d",&iValue1);
printf("Enter number of rows\n");
scanf("%d",&iValue2);
Display(iValue1,iValue2);
return 0;
}