#include<stdio.h>
struct student
{
int roll_no;
char name[20];
float marks;
};
struct student input();
void display(struct student);
void main()
{
struct student r;
clrscr();
r=input();
display(r);
getch();
}
struct student input()
{
struct student s1;
printf("Enter student data\n");
scanf("%d",&s1.roll_no);
fflush(stdin);
gets(s1.name);
scanf("%f",&s1.marks);
return(s1);
}
void display(struct student s)
{
printf("roll_no=%d\n",s.roll_no);
printf("name=%s\n",s.name);
printf("marks=%f\n",s.marks);
}
1 Comments
Good one
ReplyDelete