Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a fragment of code to: 1) input a floating point number. 2) use if stateme

ID: 3543281 • Letter: W

Question

Write a fragment of code to:
  

1) input a floating point number.     
   
  2) use if statements to print an error if it above 100 or below 0.       

3) cout appropriate message if the number is in AND an appropriate message if the number is out of the range.      
Write a fragment of code to:
  

1) input a floating point number.     
   
  2) use if statements to print an error if it above 100 or below 0.       

3) cout appropriate message if the number is in AND an appropriate message if the number is out of the range.      

Explanation / Answer

Here is how you would do it:


#include <iostream>

int main()

{

double N;

cin>>N;

if(N>100||N<0)cout<<"Error"<<endl;

else cout<<"Number is in range"<<endl;

}



Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote