Computer Science, asked by 23jadavis, 1 year ago

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

Answers

Answered by Mukeshgorain338
1

Explanation:

#include<stdio.h>

#include<conio.h>

void main()

{

float a;

printf("Enter you no");

scanf("%f",&a);

if ( a>45.6)

{

printf ("The no is grater tha 45.6");

}

elseif ( a==45.6)

{

printf ("The no is equal ");

}

else {

printf(" The number is less than 45.6");

}

getch();

}

Answered by qwvilla
0

Question :

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".

Answer :

We use java code here :

import java.util.*;

class check

{

public static void main (string args[ ])

{

float num ;

System.out.println("Enter a number :");

Scanner sc = newScanner(System.in);

num = nextFloat();

if (num> 45.6)

{

System.out.println( "Greater than 45.6");

} // End of if statement

else

{

System.out.println( "Lesser than 45.6");

} //End of else statement

} // End of main() function

} // End of Class

#SPJ3

Similar questions