-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProblem_Set_29.c
More file actions
58 lines (48 loc) · 1.34 KB
/
Problem_Set_29.c
File metadata and controls
58 lines (48 loc) · 1.34 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
// Enter address (house no,block,city,state) of 5 people
#include<stdio.h>
#include<string.h>
struct address{
int houseNo;
int block;
char city[100];
char state[100];
};
void printAdd(struct address add);
int main(){
struct address adds[4];
//Input
printf("Enter info for person 1:");
scanf("%d",&adds[0].houseNo);
scanf("%d",&adds[0].block);
scanf("%s",adds[0].city);
scanf("%s",adds[0].state);
printf("Enter info for person 2:");
scanf("%d",&adds[1].houseNo);
scanf("%d",&adds[1].block);
scanf("%s",adds[1].city);
scanf("%s",adds[1].state);
printf("Enter info for person 3:");
scanf("%d",&adds[2].houseNo);
scanf("%d",&adds[2].block);
scanf("%s",adds[2].city);
scanf("%s",adds[2].state);
printf("Enter info for person 4:");
scanf("%d",&adds[3].houseNo);
scanf("%d",&adds[3].block);
scanf("%s",adds[3].city);
scanf("%s",adds[3].state);
printf("Enter info for person 5:");
scanf("%d",&adds[4].houseNo);
scanf("%d",&adds[4].block);
scanf("%s",adds[4].city);
scanf("%s",adds[4].state);
printAdd(adds [0]);
printAdd(adds [1]);
printAdd(adds [2]);
printAdd(adds [3]);
printAdd(adds [4]);
return 0;
}
void printAdd(struct address add){
printf("Adress is : %d,%d,%s,%s\n",add.houseNo,add.block,add.city,add.state);
}