67.1k views
1 vote
Write a program to enter a number and test if it is greater than 45.6. If the number entered is greater than 45.6, the program needs to output the phrase Greater than 45.6.

Sample Run
Enter a number: 90
Sample Output
Greater than 45.6

User Niyou
by
5.1k points

1 Answer

6 votes

Answer:

float inp =0;

cin>>inp;

if(inp > 45.6)

cout<<"Greater than 45.6";

Step-by-step explanation:

the first line will initialize an float for the input you gonna give the program.

second line will get the input from the user.

third line checks if the given input is greater than 45.6 .if so , it will print "greater than 45.6"

also for your future questions , please note which language your program should be in.

User Asidis
by
5.3k points