Kodewick
Start learning →
Starter←→0 / 86

Decimal to Whole Number

#065Starter(int)price3 min

You have 7.8 yuan and a pen costs 1 yuan — how many can you buy? In other words, show 7.8 as the whole number 7. Note that it is **cut off**, not rounded.

Should show
7
main.cpp
#include <iostream>
using namespace std;

int main() {
    double price = 7.8;
    // your code here: turn price into a whole number and show it
    return 0;
}
Ctrl + Enter runs too
Result

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