Rating Division Solution

Given the rating R of a person, tell which division he belongs to. The rating range for each division are given below:

  • Division 1 Rating.

  • Division 2 Rating <2000.

  • Division 3: Rating <1600.




Input Format

  • A single line of input, which contains a single integer R.

Output Format

Output on a single line the answer: 1 if the person belongs to Division 12 if the person belongs to Division 2, and 3 if the person belongs to Division 3.

Constraints

  • 1000

Example:

Input:

1500

Output:

3

Explanation:

 Since the rating of the person lies in the range [1000,, he belongs to Division 3.

SAMPLE INPUT
 
1500
SAMPLE OUTPUT
 
3







 Program:


#include <stdio.h>

int main(){

    int num;

    scanf("%d",&num);

    if(num>=2000)

    {

        printf("1");

    }

    if(num<2000 && num>=1600)

    {

        printf("2");

    }

    else if(num<1600)

    {

        printf("3");

    }

}



Post a Comment

0 Comments