Write a program to input a real number (floating point number) and round it off to 2 places of decimal.
Answers
Answered by
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
English,
4 months ago
Computer Science,
4 months ago
Computer Science,
8 months ago
Math,
8 months ago
Math,
1 year ago
Biology,
1 year ago