Float f suffix Viva-question – Computer Sir Ki Class


Lost your password?

Don't have an account ?
Register (It's FREE) ×


Solved Problem #JAVA#3880    siteicon   siteicon  

Problem Statement - Float f suffix Viva-question

Why do we add f suffix to a decimal literal number when we initialise a float variable.


TC++ #3880

By default any decimal number like 23.34 would be assumed to be a double number. by adding f suffix like 23.34f we tell the compiler to reserver on 32 bits for the given number as against the use of 64 bits it would have done if we do not add the suffix.


sunmitra| Created: 21-Mar-2018 | Updated: 21-Mar-2018|