Computer Science, asked by akshatha5275, 9 months ago

You went on a tour to Ooty with your friends. As a part of the tour, you went boating with them. For the boat to remain stable, the number of people on one boat is restricted based on the weight of the people. You find that the boatman who is sailing your boat is so much greedy of money. For earning more, he takes too many people to travel in the boat at a time. So you want to check how many people can travel in the boat at a time so that the boat will not drown. Calculate the weight by considering the number of adults and number of children. Assume that an adult weighs 75 kg and children weigh 30 kg each. If the weight is normal, display Boat is stable, else display Boat will drown.

Answers

Answered by noushin99882
28

Answer:

#include<iostream>

using namespace std;

int main()

{

 

 int a,b,c,g,f,h;

 cin>>a>>b>>c;

 //out<<a<<"\n"<<b<<c;

 g=b*75;

 f=c*30;

 h=g+f;

 if(h<=a){cout<<"Boat is stable";}

 else{cout<<"Boat will drow";}

 //cout<<h;

}

Explanation:

Answered by sawarkarshubham80
0

Explanation:

#include<stdio.h>

int main ( ){

int weight , NumberOfAdults , NumberOfChildren;

int Wh , Na , Nc;

scanf("%d",&weight);

scanf("%d",&NumberOfAdults);

scanf("%d",&NumberOfChildren);

Wh = NumberOfAdults * 75;

Na = NumberOfChildren * 30;

Nc = Wh + Na ;

if ( Nc <= weight ) {

printf ("Boat is stable \n );

}

else {

printf ( " Boat will drawn " );

}

return 0 ;

}

Similar questions