Canna

Sunday, 23 September 2018

Better or Not

Problem Description

One criteria for evaluating 2 different colleges is based on the student strength.

Write a program to compare 2 colleges based on the student strength.

Input Format:

Input consists of 2 integers. The first integer corresponds to the number of students in college 1 and the second integer corresponds to the number of students in college 2.

Output Format:

Output consists of the string College 1 is better or College 2 is better.

Refer sample input and output for further formatting specifications.

Sample Input and Output:

[All text in bold corresponds to input and the rest corresponds to output]

  • Test Case 1

    Input (stdin)
    1000
    
    2000
    
    
    Expected Output
    College 2 is better
  • Test Case 2

    Input (stdin)
    2001
    
    1999
    
    
    Expected Output
    College 1 is better
  • Program
  • #include <stdio.h>
    int main()
    {
      int a;
      int b;
      scanf("%d%d",&a,&b);
      if(a<b)
      printf("College 2 is better");
        else
        printf("College 1 is better");
    
     return 0;
    }

No comments:

Post a Comment

Note: only a member of this blog may post a comment.