-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram111.c
More file actions
54 lines (43 loc) · 815 Bytes
/
Program111.c
File metadata and controls
54 lines (43 loc) · 815 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
/*
Row = 4
Col = 4
@ 2 3 4
1 @ 3 4
1 2 @ 4
1 2 3 @
*/
#include<stdio.h>
void Display(int iRow, int iCol)
{
int i = 0, j = 0;
if(iRow != iCol)
{
printf("Row number and column numbers are diffrent\n");
return;
}
for(i = 1; i<= iRow; i++)
{
for(j = 1; j<=iCol; j++)
{
if(i == j)
{
printf("@\t");
}
else
{
printf("%d\t",j);
}
}
printf("\n");
}
}
int main()
{
int iValue1 = 0, iValue2 = 0;
printf("Enter number of rows\n");
scanf("%d",&iValue1);
printf("Enter number of columns\n");
scanf("%d",&iValue2);
Display(iValue1,iValue2);
return 0;
}