1.

What is the output of this program?
#include <iostream>
#include <math.h>
using namespace std;
double Function(double n)
{
if (n < 0.0)
throw "Cannot take sqrt of negative number";
return sqrt(n);
}
int main()
{
double n = 16;
cout << Function(n) << endl;
}

A. 0.0
B. 16
C. 4
D. Compilation Error
E. None of these
Answer» D. Compilation Error


Discussion

No Comment Found

Related MCQs