172k views
0 votes
Given a floating point variable fraction, write a statement that displays the value of fraction on the screen. Do not display anything else on the screen-- just the value of fraction.

User Nanna
by
7.5k points

1 Answer

4 votes

Answer:

Program:

The below program in c-language

int main()// main function

{

float a,b; //variable declaration //1

a=4.89,b=6.9;// assign the value//2

printf("%f",b/a);// statement to display the fraction value.//3

return 0;// return statement.

}

Output:

1.411043

Step-by-step explanation:

The fraction value is a value that comes when a number is divided with another number. The description of the statement which used in the above program is as follows--

  1. Defined a"main" function that needs to starts the execution.
  2. Declare a two-variable "a" and "b" of type "float" and assign the value on its.
  3. This statement is used to display the fraction of value on the screen in which the "print()" function is used to display the value and "%f" is used to display the float type value and "b/a" is used to calculate the fraction.

User Gustavo Rodrigues
by
6.6k points