Friday, August 17, 2018

CLASS REPRESENTATIVE

  • Problem Description

    A student is eligible to be a class representative if his or her attendance % and marks is greater that 90% and he or she doesnt have any arrears. Given the attendance % ,mark % and number of arrears, write a C program to determine whether a student is eligible to be a Class Representative or not.

    Input format:
    Input consists of 2 float and an integer. The first float corresponds to the attendance % and the second float corresponds to the percentage of marks. The third input is an integer which corresponds to the number of arrears.

    Output format :
    Output consists of the string "Eligible " or "Not Eligible"
    Refer sample input and output for further formatting specifications.
  • CODING ARENA
  • #include <stdio.h>
    int main()
    {
      int c;
      float a,b;
      scanf("%f%f%d",&a,&b,&c);
      if(a>90 && b>90 && c==0)
        printf("Eligible");
      else
        printf("Not Eligible");

    return 0;
    }
  • Test Case 1

    Input (stdin)
    100.0
    
    96.3
    
    0
    
    
    Expected Output
    Eligible
  • Test Case 2

    Input (stdin)
    80.0
    
    80.0
    
    5
    
    
    Expected Output
    Not Eligible

1 comment: