-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStructure2.c
54 lines (42 loc) · 1.47 KB
/
Structure2.c
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
#include <stdio.h>
#include <conio.h>
// We made a container where we can store the data named as Books;
//Here we defined some variables which we are going to use like pages price date months year;
// struct Books{
// int pages,price,date,months,year;
// };
struct Books{
int date,months,year;
};
void printinput(struct Books Printing);
// struct Books BookChanger();
int main(){
struct Books arrays[4];
// struct Books BookTarget;
// BookTarget = BookChanger();
// printinput(BookTarget);
printf("\nHurray!!");
return 14;
}
// struct Books BookChanger(){
// struct Books P;
// printf("Enter the number of pages : ");
// scanf("%d",&P.pages);
// printf("Enter the price value for book : ");
// scanf("%d",&P.price);
// printf("Enter Date which time it is published : ");
// scanf("%d/%d/%d",&P.date,&P.months,&P.year);
// return P;
// }
void printinput(struct Books Printing){
// printf("The pages in the book is \n%d \nThe price is \n%d \nThe published date is in Day/Months/Year format is \n%d-%d-%d",Printing.pages,Printing.price,Printing.date,Printing.months,Printing.year);
printf("The published date is in Day/Months/Year format is \n%d-%d-%d",Printing.date,Printing.months,Printing.year);
}
struct Books arraybook(struct Books array){
struct Books Arr[4];
printf("Enter the value : ");
for(int i=0;i<4;i++){
scanf("%d/%d/%d",&Arr[i].date,&Arr[i].months,&Arr[i].year);
}
return Arr;
}