Kodewick
Start learning →
Basic←→0 / 60

Split the fuel

#009BasicOutput3 min

Three friends go on a road trip and share the fuel. Show Each pays 15.67: divide fuel by friends, and use fixed << setprecision(2) for two decimal places.

Should show
Each pays 15.67
main.cpp
#include <iostream>
#include <iomanip>
using namespace std;

int main() {
    double fuel = 47.0;
    int friends = 3;
    // your code here: show what each one pays, with two decimal places
    return 0;
}
Ctrl + Enter runs too
Result

Run tries the examples. When they look right, Submit.