Computer Science, asked by ajoyteron111, 1 year ago

What will be the result of a=5/3 if a is (i) float (ii) int

Answers

Answered by sameersamain565
11

ii int becouse it is the fraction of not in the 2mx5n so that is the int value of your question my friends.


ajoyteron111: This is not the answer bro we have to show the results in term of float or integers
Answered by Anonymous
7

The result of a = 5/3 will be

(i) 1.667 if a is float

(ii) 1 if a is int

In the first case, it is given that 'a' is a variable of float data type. A float data type is one that can store decimal values. If a fraction like 5/3 is assigned to float data type variable then it will store the complete value after the decimal.

In the second case, we have 'a' as a variable of int data type which stores only integer values. An int data type stores perfect integer values therefore, if assigned a fraction it will take only the quotient as the value and ignore everything after the decimal.

Similar questions