Question
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
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
Answer: Option A
Was this answer helpful ?
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 ?
Submit Solution