Last Updated :
10 Apr, 2024
Predict the output:
#include<iostream>
#include<iomanip>
using namespace std;
int main()
{
float c = 5.0;
float far = (9/5)*c + 32;
cout << fixed << \"Temperature in Fahrenheit is \"<< setprecision(2) << far;
return 0;
}
(A) Temperature in Fahrenheit is 41.00
(B) Temperature in Fahrenheit is 37.00
(C) Temperature in Fahrenheit is 0.00
(D) Compiler Error
Answer: (B)
Explanation: Temperature in Fahrenheit is printed with 2 decimal place using set-precision
Share your thoughts in the comments
Please Login to comment...