Linear List

QUESTION

The DS Faculty wants to know number of students got pass 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 m1;
  }s[100];
int main()
{
  int i,n,c=0;
  char k[50];
  for(i=0;i<10;i++)
    scanf("%s %d",s[i].name,&s[i].m1);
     for(i=0;i<10;i++)
     {
       if(s[i].m1>=50)
       {
         c=c+1;
       }}
  printf("\n Number of the student got pass 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.

Powered By
100% Free SEO Tools - Tool Kits PRO