-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaddress_of_five_people_using_structure.c
More file actions
56 lines (46 loc) · 1.11 KB
/
address_of_five_people_using_structure.c
File metadata and controls
56 lines (46 loc) · 1.11 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
#include<stdio.h>
#include<string.h>
struct address{
int house_no;
int block;
char city[100];
char state[100];
};
void printadd(struct address add)
{
printf("%d, %d, %s,%s",add.house_no,add.block,add.city,add.state);
}
int main()
{
struct address add[5];
printf("enter address of first person\n");
scanf("%d",&add[0].house_no);
scanf("%d",&add[0].block);
scanf("%s",add[0].city);
scanf("%s",add[0].state);
printf("enter address of 2 person\n");
scanf("%d",&add[1].house_no);
scanf("%d",&add[1].block);
scanf("%s",add[1].city);
scanf("%s",add[1].state);
printf("enter address of 3 person\n");
scanf("%d",&add[2].house_no);
scanf("%d",&add[2].block);
scanf("%s",add[2].city);
scanf("%s",add[2].state);
printf("enter address of 4 person\n");
scanf("%d",&add[3].house_no);
scanf("%d",&add[3].block);
scanf("%s",add[3].city);
scanf("%s",add[3].state);
printf("enter address of 5 person\n");
scanf("%d",&add[4].house_no);
scanf("%d",&add[4].block);
scanf("%s",add[4].city);
scanf("%s",add[4].state);
printadd(add[0]);
printadd(add[0]);
printadd(add[0]);
printadd(add[0]);
printadd(add[0]);
}