Computer Science, asked by sukanya26, 1 year ago

what are the resultant data types if the following implicit type conversions are performed?Show the result with flow lines.int i;float f;double d;char c;byte b;(a)i+c/b;(b)f/d+c*f;(c)i+f-b*c;(d)(f/i)*c+s;(e)i+f-c+b/d;(f)i/c+f/b;​

Answers

Answered by Gou2004
46

Answer:

a. int, char, double

b. float, double, char, float

c. int, float, byte, char

d. float, int, char, short

e. int, float, char, byte, double

f. int, char, float, byte

Answered by qwblackurnrovers
2

(a) int (b) double (c) float (d) float (e) double

Given:

int, float , double , char , byte are for the following options to get correct flowlines

To Find:

The variables which are given in fractions and to find their flowlines of them.

Solution:

Consider option (a),

i +\frac{c}{b}

= int + \frac{char}{byte}

= int + char

= int

Taking option (b),

\frac{f}{d} + c × f

= \frac{float}{double} + char × float

= double + float

= double

Option (c),

i+f -b × c

= int + float - byte × char

= int + float - char

=float - char

= float

Option(d),

\frac{i}{c}  +  \frac{f}{b}

= \frac{int}{char} + \frac{float}{byte}

= int + float

= float

Option (e),

i + f- c+ \frac{b}{d}

= int + float -char + \frac{byte}{double}

= int + float - char +double

= float - char + double

= double

The answers for options a, b ,c, d, e is int , double , float , float, double

#SPJ3

Similar questions