-
Notifications
You must be signed in to change notification settings - Fork 0
/
structure.c
39 lines (36 loc) · 868 Bytes
/
structure.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
#include <stdio.h>
#include <string.h>
struct Student
{
int id;
int marks;
char fav_char;
char name[34];
} harry, ravi, shubham;
// struct Student harry, ravi, shubham;
void print()
{
printf("%s", harry.name);
}
int main()
{
harry.id = 1;
ravi.id = 2;
shubham.id = 3;
harry.marks = 66;
ravi.marks = 466;
shubham.marks = 46;
harry.fav_char = 'p';
ravi.fav_char = 'y';
shubham.fav_char = 'o';
strcpy(harry.name, "Harry Potter student of the year");
strcpy(shubham.name, "Shubham Kumar");
// printf("Harry got %d marks\n", harry.marks);
// printf("Harry's name is: %s\n", harry.name);
// printf("Shubham got %d marks\n", shubham.marks);
// printf("Shubham's name is: %s\n", shubham.name);
print();
// Quick Quiz
// print all the information of a given student
return 0;
}