Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- /// Returns the percentage % of n
- double percentage(double n, double percentage) {
- return (n / 100) * percentage;
- }
- int main () {
- using namespace std;
- int n;
- cin >> n;
- cout << "Sconto sara' di: " << percentage(n, 20) << endl
- << "Prezzo rimanente di: " << n - percentage(n, 20) << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement