Home » C Programming » Data Types » Question
  1. We want to round off x, a float, to an int value. The correct way to do so will be
    1. y = ( int ) ( x + 0.5);
    2. y = int ( x +0.5 );
    3. y = ( int ) x + 0.5;
    4. y = ( int ) ( ( int ) x + 0.5 )
Correct Option: A

y = ( int ) ( x + 0.5);



Your comments will be displayed only after manual approval.