Problem Description
When parents take their kids for Engineering Counselling , they always go with a preconceived notion that older the college, better will be the quality of education offered. There is a help desk in front of the counselling hall to tell out of the colleges in which seats are available., which college is the older one.
Now a days ,engineering counselling goes on for a month and the help desk need to function on all days. So the Dean, Admissions decided to automate this task. Can you help him in this task?
Given the year of establishment of 2 colleges , write a C program to determine which colleges is the older one.
Input format:
Input consists of 2 integers. The first integer corresponds to the year of establishment of college 1 and the second integer corresponds to the year of establishment of college 2
Output format:
Output consists of the string "College 1 is older " or "College 2 is older".
Refer sample input and output for further formatting specifications.Test Case 1
Input (stdin)2002 2008
Expected OutputCollege 1 is older
Test Case 2
Input (stdin)2015 1990
Expected OutputCollege 2 is older
Program
#include <stdio.h> int main() { int a,b; scanf("%d%d",&a,&b); if(a<=b) printf("College 1 is older"); else if(b<=a) printf("College 2 is older"); return 0; }
No comments:
Post a Comment
Note: only a member of this blog may post a comment.