Program: 89
In boxing the weight class of a boxer is decided as per the following table. Write a c program that receives weight as input and prints out the boxer’s weight class.
#include<stdio.h> #include<conio.h> int main() { float weight; //weight in pounds printf("Enter the weight in pounds: "); scanf("%f", &weight); if(weight<115) printf("Boxer's Weight Class is Flyweight"); else if(weight>=115 && weight<=121) printf("Boxer's Weight Class is Bantamweight"); else if(weight>=122 && weight<=153) printf("Boxer's Weight Class is Featherweight"); else if(weight>=154 && weight<=189) printf("Boxer's Weight Class is Middleweight"); else if(weight>=190) printf("Boxer's Weight Class is Heavyweight"); else printf("You entered wrong entry"); }
Output:
Enter the weight in pounds: 140
Boxer's Weight Class is Featherweight
Leave a Comment