Write code to display ‘Too loud’ if sound decibel is greater than 40 dB. If sound decibel is less than 40 dB, display ‘Correct Volume’.

Respuesta :

The given code is in c++ .

#include<iostream>

using namespace std;

int main( ){

     int s ;

     cout<< "Enter sound in decibel "<<endl;

     cin>> s;

     if( s > 40 ){

           cout<< "Too loud "<<endl;

     }

     else{

           cout<< "Correct Volume"<<endl;

     }

     return 0;

}

//Hence, this is the required solution.