#include<stdio.h>
#include<conio.h>
#include<string.h>
#define N 10
void dummy(float *a){
float b=*a; //perform some floating access
dummy (&b); //calling a floating point function
}
struct student{
int rollno;
char name[20];
char gender;
float fees;
};
void main() {
int i;
struct student s[N];
for (i=0;i<N;i++){
clrscr();
printf("Enter %d student detail:-\n",i+1);
printf("Enter roll number\n");
scanf("%d",&s[i].rollno);
getch();
printf("Enter student name\n");
fflush(stdin);
gets(s[i].name);
getch();
printf("Enter gender\n");
fflush(stdin);
scanf("%c",&s[i].gender);
getch();
printf("Enter fees\n");
fflush(stdin);
scanf("%f",&s[i].fees);
getch();
}
clrscr();
for (i=0;i<N;i++) {
printf("\nDetails of %d student:-\n",i+1);
printf("Roll no=%d\n Name=%s\n Gender=%c\n Fees=%f .rs\n",s[i].rollno,s[i].name,s[i].gender,s[i].fees);
getch();
}
}
No comments:
Post a Comment