-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlist_client.c
More file actions
64 lines (62 loc) · 2.65 KB
/
list_client.c
File metadata and controls
64 lines (62 loc) · 2.65 KB
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
56
57
58
59
60
61
62
63
64
#include<stdio.h>
#include<stdlib.h>
#include"list.h"
int main()
{
matrix_t m1;
matrix_t m2;
matrix_t m3;
int choice;
char file_1[20];
char file_2[20];
int r1,c1,r2,c2;
printf("Enter the first file name\n");
scanf("%s", file_1);
printf("Enter its row size & coloumn size\n");
scanf("%d%d", &r1,&c1);
printf("Enter the second file name\n");
scanf("%s", file_2);
printf("Enter its row size & coloumn size\n");
scanf("%d%d",&r2, &c2);
m1=init(m1,r1,c1);
m2=init(m2,r2,c2);
//create the list of first matrix
m1=create_list(m1,file_1);
//Creating the list of second matrix
m2=create_list(m2,file_2);
printf("_____________________________________________________________________________________________________________________________________________\n");
printf("First matrix list\n");
printf("______________________________________________________________________________________________________________________________________________\n");
display(m1);
printf("_______________________________________________________________________________________________________________________________________________\n");
printf("Second matrix list\n");
printf("_______________________________________________________________________________________________________________________________________________\n");
display(m2);
printf("_______________________________________________________________________________________________________________________________________________\n");
printf("\t\t\t\t\t Operations menu\n");
printf("1.Add\n");
printf("2.Multiply\n");
scanf("%d", &choice);
switch(choice)
{
case 1:
m3=add_matrix(m1,m2,m3);
printf("___________________________________________________________________________________________________________________________\n");
printf("Sum list\n");
printf("_____________________________________________________________________________________________________________________________\n");
display(m3);
printf("______________________________________________________________________________________________________________________________\n");
break;
case 2:
m3=multiply_matrix(m1,m2,m3);
printf("____________________________________________________________________________________________________________________________\n");
printf("Product list \n");
printf("______________________________________________________________________________________________________________________________\n");
display(m3);
printf("____________________________________________________________________________________________________________________________\n");
break;
deafault:
exit(0);
}
return 0;
}