Computer Science, asked by brahman1629, 8 months ago

Write a program to input a real number (floating point number) and round it off to 2 places of decimal.​

Answers

Answered by shristipal
2

Answer:

First Method:- Using Float precision

#include <iostream>

using namespace std;

int main()

{

float var = 37.66666;

// Directly print the number with .2f precision

printf("%.2f", var);

return 0;

}

Similar questions