Question Solved1 Answer A war game is conducted between two countries A and B. Country Aat its Air Force Base in Rimnicu Vilcea has some Rockwell B-1Lancer Heavy Bombers and some Mitsubishi F-3 Fighters. Sincebombers are comparatively slow and are not easily maneuverable eachbomber should be accompanied by at least a squadron of threefighters. Rimnicu Vilcea Air Force Base has over 5000 liter offuel, 200 pilots, 4 wing commanders and an Air Marshal. Moreover,enemy airfields of Sibiu and Fagaras are within reach of thebombers from Rimnicu Vilcea. So, airfields of Rimnicu Vilcea shouldremain operational, it is vital for winning the war. According toAir Marshal Prince Constantin Cantacuzino, “we need at least 10fighters in the air to defend against their first wave ofattack”.Assume that both Rockwell B-1 Lancer Heavy Bomberand Mitsubishi F-3 Fighter can be operated by a single pilot.Assume that all the pilots, wing commanders and Air Marshal arecompetent pilots but due to tactical reasons Air Marshals are notallowed to participate in any flying missions.Write a C program to read the number of fighters and bombersfrom the user and identify the maximum numbers Rockwell B-1 HeavyBombers that can be sent on a bombing run at a time by country A sothat airfields of Rimnicu Vilcea won’t be vulnerable to air raidsfrom Country B’s bombers?You have input the number of fighter first followed by thenumber of bombers.Sample Input/Output Input: 0 0 Output 0

M4PLPT The Asker · Computer Science

A war game is conducted between two countries A and B. Country A at its Air Force Base in Rimnicu Vilcea has some Rockwell B-1 Lancer Heavy Bombers and some Mitsubishi F-3 Fighters. Since bombers are comparatively slow and are not easily maneuverable each bomber should be accompanied by at least a squadron of three fighters. Rimnicu Vilcea Air Force Base has over 5000 liter of fuel, 200 pilots, 4 wing commanders and an Air Marshal. Moreover, enemy airfields of Sibiu and Fagaras are within reach of the bombers from Rimnicu Vilcea. So, airfields of Rimnicu Vilcea should remain operational, it is vital for winning the war. According to Air Marshal Prince Constantin Cantacuzino, “we need at least 10 fighters in the air to defend against their first wave of attack”.

Assume that both Rockwell B-1 Lancer Heavy Bomber and Mitsubishi F-3 Fighter can be operated by a single pilot. Assume that all the pilots, wing commanders and Air Marshal are competent pilots but due to tactical reasons Air Marshals are not allowed to participate in any flying missions.

Write a C program to read the number of fighters and bombers from the user and identify the maximum numbers Rockwell B-1 Heavy Bombers that can be sent on a bombing run at a time by country A so that airfields of Rimnicu Vilcea won’t be vulnerable to air raids from Country B’s bombers?

You have input the number of fighter first followed by the number of bombers.

Sample Input/Output

Input:

0 0
Output

0

More
See Answer
Add Answer +20 Points
Community Answer
HMLKJB The First Answerer
See all the answers with 1 Unlock
Get 4 Free Unlocks by registration

#include <stdio.h> int main() { // declare variables int numFighters; // number of fighters int numBombers; // number of bombers // read inputs // first number of fighter then number of bombers scanf("%d %d", &numFighters, &numBombers); // decrement number of fighter by 10 numFighters -= 10; int numPilots = 194; // 200 pilots - 4 wing commanders int numBombersSent = 0; // let the number of bombers to sent be zero // run loop until // a squadron have at least three fighters, and // number of bombers greater than zero, and // have at least 4 pilots while (numPilots >= 4 && numFighters >= 3 && numBombers > 0) { numBombersSent += 1; // send one bomber numBombers -= 1; // and reduce and update bomber count numFighters -= 3; // reduce and update fighters numPilots -= 4; // reduce and update pilots } // print the computed number of // bombers to sent printf("%dn", numBombersSent); return 0; }#include <stdio.h> int main() { // declare variab ... See the full answer