Sail E0 Webinar
Question


What is the output of the following program?


1.
#include
2.
using namespace std;
3.
int main()
4.
{
5.
float i = 123.0f;
6.
cout
Options:
A .  123.00
B .  1.23
C .  123
D .  compile time error
Answer: Option C

The value 123 is printed because of its precision.
$ g++ float.cpp
$ a.out
123



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers