Codechef Problems: Remaining Money (REMMON)

 Problem Statement: 


Solution: 

Given, 
    N : amount of money chef has 
    A : number of ice-cream chef buys 
    B : price of each ice-cream 

to find : how much of the chef's money is remaining 

total price of ice-creams = A * B 
remaining money = N - (A * B)

Code Solution: 

#include <bits/stdc++.h>

using namespace std;

int main() {
    int n, a, b;
    cin >> n >> a >> b;

    cout << n - (a * b) << endl;
    return 0;
}

Comments

Popular Posts