Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* program to display details of n students */
- #include<conio.h>
- #include<stdio.h>
- int main()
- {
- int n,i;
- struct student
- {
- int rollno;
- char name[20];
- int mark;
- }s[20];
- printf("Enter no of students: ");
- scanf("%d",&n);
- printf("ENTER DETAILS OF STUDENTS");
- for(i=0;i<n;i++)
- {
- printf("\nEnter the Roll No:");
- scanf("%d",&s[i].rollno);
- printf("Enter name of Student:");
- scanf("%s",&s[i].name);
- printf("Enter mark of Student:");
- scanf("%d",&s[i].mark);
- }
- for(i=0;i<n;i++)
- {
- if(s[i].mark >= 75)
- {
- printf("\nSTUDENT %d HAS MARK >75\n",i+1);
- printf("Roll No:%d\n",s[i].rollno);
- printf("Name of Student:%s\n",s[i].name);
- printf("Mark of Student:%d\n",s[i].mark);
- }
- else
- {
- printf("STUDENT %d HAS MARK BELOW 75\n",i+1);
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment