Sunday, 8 February 2015


Ans C

now int, char and double are basically datatypes in C language.lets understand what each of them mean

A] Int is used to define integers.
int i;
i = 5;
here i is defined as integer (basically it is a memory location allocated to store integer value) and assigned a value 5.
  
B] char is used to define character.
char let ; 
let = 'x';

C] double use to define floating point numbers (e.g = 5.46  , 6.81)
double j  ;
j = 4.5;

Now consider above question we have,
  int i = 3;
  int j = 7;
  double  f = 5.5 ;
double g = 4.5;
char ch = 'T' ;

  • ||  means OR  
  • && means AND   
  • == means Equal to

Consider option A


 (i < = 5 ) && ( ch == 'T')
for above eq. to give true value both expression should be true lets check them.

as i =3  it is less than 5 so first expression is indeed true.
now ch = 'T' is also given in question so it is also true as both expressions are true above equation will give vale  TRUE.

Consider option B

(i < 8 )  || ( ch = ' L')
for above eq. to give true value one expression should be atleast true lets check them.
as i =3  it is less than 8 so first expression is indeed true.
so above equation gives TRUE value.

Consider option C

(f > 6)  || (i*j < 15)

as f = 5.5 first expression is false
i* j = 16.5  which is greater than 15 so this expression is also false.
so the value of equation is FALSE


So option C is correct option.


No comments:

Post a Comment