1.Split the bill
BeginnerA dinner costs 1850 rupees and 4 friends split it equally. Print each share with exactly two decimal places, like Each person pays 462.50.
Show hint
Make sure the division is done in floating point, then use std::fixed and std::setprecision(2) from <iomanip>.
Show solution
#include <iomanip>
#include <iostream>
int main() {
double total = 1850;
int people = 4;
double share = total / people;
std::cout << std::fixed << std::setprecision(2);
std::cout << "Each person pays " << share << '\n';
}Each person pays 462.50