Less Mark in List

QUESTION

The PDD teacher wants to know number of students got fail mark in CT I if she has a unordered list of marks for 10 students

ANSWER

#include <stdio.h>
struct student
{
  char name[50];
  int marks;
}s[100];
int main()
{
  int c,i;
  for(i=0;i<10;i++)
  scanf("%s %d",s[i].name,&s[i].marks);
  
  for(i=0;i<10;i++)
  {
    if(s[i].marks<50)
      c=c+1;
  }
  printf("Number of the student got fail marks %d",c);
	return 0;
}
Ads Blocker Image Powered by Code Help Pro

Ads Blocker Detected!!!

We have detected that you are using extensions to block ads. Please support us by disabling these ads blocker.