asked 185k views
25 votes
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’.

asked
User Machaku
by
7.6k points

1 Answer

8 votes

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.

answered
User Anmatika
by
8.1k points
Welcome to Qamnty — a place to ask, share, and grow together. Join our community and get real answers from real people.