AbdulFathaah

student mark>75

Nov 20th, 2023 (edited)
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. /* program to display details of n students */
  2. #include<conio.h>
  3. #include<stdio.h>
  4. int main()
  5. {
  6. int n,i;
  7. struct student
  8. {
  9. int rollno;
  10. char name[20];
  11. int mark;
  12. }s[20];
  13. printf("Enter no of students: ");
  14. scanf("%d",&n);
  15. printf("ENTER DETAILS OF STUDENTS");
  16. for(i=0;i<n;i++)
  17. {
  18. printf("\nEnter the Roll No:");
  19. scanf("%d",&s[i].rollno);
  20. printf("Enter name of Student:");
  21. scanf("%s",&s[i].name);
  22. printf("Enter mark of Student:");
  23. scanf("%d",&s[i].mark);
  24. }
  25. for(i=0;i<n;i++)
  26. {
  27. if(s[i].mark >= 75)
  28. {
  29. printf("\nSTUDENT %d HAS MARK >75\n",i+1);
  30. printf("Roll No:%d\n",s[i].rollno);
  31. printf("Name of Student:%s\n",s[i].name);
  32. printf("Mark of Student:%d\n",s[i].mark);
  33. }
  34. else
  35. {
  36. printf("STUDENT %d HAS MARK BELOW 75\n",i+1);
  37. }
  38. }
  39. return 0;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment