Hi and welcome to Placement Yogi ! You can find all your placement related queries here.
The Website is backed by a strong group of Professionals from Companies like Cisco, McAfee,Juniper,Symphony, TCS, Cognizant.
Our Aim is to get you placed!
And we DO NOT like to FAIL!!
What is the output of the following program:
void main( )
int i = 2, j = 3, k, l ;
float a, b ;
k = i / j * j ;
l = j / i * i ;
a = i / j * j ;
b = j / i * i ;
printf( "%d %d %f %f", k, l, a, b ) ;
3 3 2 2
3 3 0 2.000000
3 2 0.000000 3.000000
0 2 0.000000 2.000000
RHS is evaluated first and then the value is promoted to float, float arithmetic is not used here as there is no variable on the RHS that is float.
The Float is printed with decimal followed by 6 zeros.
why there is 6 zeroes?
I couldnt get you expain me breifly i am new to the programs
I count understand logic i m new to the code . pls any one explain me the logic