Type the Question

Saturday, February 16, 2019

Question Name:Less Mark in List

#include <stdio.h>
int main()
{
int a[10],count=0,i;
char k[10];
for(i=0;i<10;i++)
{scanf("%s",k);
scanf("%d",&a[i]);

if(a[i]<50)
{
count++;
}
}
printf("Number of the student got fail marks %d",count);
return 0;
}

Problem Description

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

  • Test Case 1
    Input (stdin)
    Thomas 75
    Imran 60
    Sithik 80
    Setan 80
    Milton 85
    Arjun 42
    Rakesh 91
    Hrithik 88
    Ayush 85
    Aswathy 55
    Expected Output
    Number of the student got fail marks 1
  • Test Case 2
    Input (stdin)
    Thomas 75
    Imran 60
    Sithik 80
    Setan 80
    Milton 85
    Arjun 85
    Rakesh 91
    Hrithik 88
    Ayush 85
    Aswathy 55
    Expected Output
    Number of the student got fail marks 0

No comments:

Post a Comment

Question Name:TOWER OF HANOI

#include < bits / stdc ++. h > #define lli long long using namespace std ; lli dp [ 202 ]; int main () { int t , n ; ...