King Indravarma ordered his servants to distribute gifts for the people. They arranged for the gifts and kept them in a room. Dolu and Bolu are excited about gifts.Kalia is up to his mischievous self again. He tied balloons to all the gifts that the king had kept for distributing to the people. The balloons are tied in height of 50m to 90m above the ground. He challenged Bheem to shoot down the balloons and collect all the gifts by blindfolding his eyes. Write a program to help Bheem to shoot down the balloons.
Input and Output Formats
Input contains a single integer h. The height at which bheem shoot.
The output should display “Hurray !!!” if he shots correctly. Otherwise, display “Aim High” or Aim Low”.
Sample Input and Output 1:
Enter the height of the shot
67
Hurray !!!
Sample Input and Output 2:
Enter the height of the shot
47
:-( Aim High
Sample Input and Output 3:
Enter the height of the shot
120
:-( Aim Low
Program Code:
#include<stdio.h>
int main()
{
int n;
printf("Enter the height of the shot\n");
scanf("%d", &n);
if(n>50 && n<90)
printf("Hurray !!!");
else if(n>=90)
printf(":-(Aim Low");
else
printf(":-(Aim High");
return 0;
}
Post A Comment:
0 comments: