Computer Science, asked by pratapnarayan1974, 9 months ago

Int n=15.4;give reasons why it's false

Answers

Answered by pranvi2704
3

It's wrong because you have entered the value in decimal and the data type is int which means integer..

So you have to use double data type...

Answered by gurukulamdivya
3

Answer:

int n means that u have declared a variable of integer type i.e. it can contain all positive or negative without a decimal point.

for decimal number u can use  another data type such as float or double.

int n=15; is correct

and if u need to store decimal number than

float n=15.4; or double =15.4;

Similar questions