KnowledgeBoat Logo

Computer Applications

Assign the following to a variable with suitable data type.

(a) m = 22 / 7

(b) p= 1.4142135 (value of square root of 2)

(c) k= 0.00004545

(d) n=24.50

Values & Data Types Java

ICSE

51 Likes

Answer

(a) m = 22 / 7

double m = (22.0 / 7.0);

(b) p= 1.4142135 (value of square root of 2)

double p = 1.4142135;

(c) k= 0.00004545

double k = 0.00004545;

(d) n=24.50

float n = 24.50f;

Answered By

31 Likes


Related Questions