- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstruct_pointer.c
More file actions
Latest commit
32 lines (29 loc) · 638 Bytes
/
Copy pathstruct_pointer.c
File metadata and controls
32 lines (29 loc) · 638 Bytes
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
#include<stdio.h>
structstudent
{
introllno;
charname[20];
floatpercent;
};
voidaddstudent(structstudent*s)
{
printf("Enter the student Rollno:");
scanf("%d", &s->rollno);
printf("Enter student Percentage:");
scanf("%f",&s->percent);
printf("Enter the Name: ");
scanf("%s", &s->name);
}
voidshowstudent (structstudents)
{
printf("Now Displaying Student Details as:\n");
printf("\n Name:%s", s.name);
printf("\n RollNumber:%d", s.rollno);
printf("\n Marks: %f", s.percent);
}
intmain()
{
structstudents;
addstudent(&s);
showstudent(s);
}