Sail E0 Webinar
Question


What is the output of this program?


1.
#include
2.
using namespace std;
3.
int main()
4.
{
5.
float num1 = 1.1;
6.
double num2 = 1.1;
7.
if (num1 == num2)
8.
cout
Options:
A .  harvard
B .  stanford
C .  compile time error
D .  runtime error
Answer: Option A

Float store floating point numbers with 8 place accuracy and requires 4 bytes of Memory. Double 

has 16 place accuracy having size of 8 bytes.
Output:
$ g++ float3.cpp
$ a.out
harvard



Was this answer helpful ?
Next Question

Submit Solution

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

Latest Videos

Latest Test Papers