-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstructure.c
40 lines (33 loc) · 856 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
40
#include<stdio.h>
#include<string.h>
struct student {
int roll;
float cgpa;
char name[100];
};
int main(){
struct student s1;
s1.roll=3;
s1.cgpa=7.5;
strcpy(s1.name,"Bhavesh");
printf("student Name :%s\n",s1.name);
printf("student roll no :%d\n",s1.roll);
printf("student cgpa :%f\n",s1.cgpa);
printf("/n");
struct student s2;
s2.roll=4;
s2.cgpa=7.9;
strcpy(s2.name,"rajat");
printf("student Name :%s\n",s2.name);
printf("Student Roll no:%d\n",s2.roll);
printf("Student cgpa : %f\n",s2.cgpa);
printf("\n");
struct student s3;
s3.roll=6;
s3.cgpa=9.6;
strcpy(s3.name,"vyom");
printf("Student Name :%s\n",s3.name);
printf("Student Roll no :%d\n",s3.roll);
printf("Student cgpa :%f\n",s3.cgpa);
return 0;
}