C File =>
/* Write a C program to store and display the name, rollno and fees of a student using structure. Pass the member of structure variable to a function called display() to display the contents.*/
#include<stdio.h>
#include<stdlib.h>
typedef struct Student
{
int rno;
char name[30];
float fees;
};
//global declaration of structure member
struct Student s;
int main() {
printf("\n Enter Roll number : ");
scanf("%d",&s.rno);
printf("\n Enter name : ");
scanf("%s",s.name);
printf("\n Enter fees : ");
scanf("%f",&s.fees);
void display(struct Student s)
{
printf("\n\n Roll number : %d",s.rno);
printf("\n Name : %s",s.name);
printf("\n Fees : %f",s.fees);
}
display(s);
return 0;
}
Comments
Post a Comment
Please do not enter any spam link in message.