My issue
include
using namespace std;
int main() {
int x,y,z,total_rs,max_cho;
cout<<“Enter the number of 5rs coin
<<endl;
cin>>x;
cout<<“Enter the number of 10rs coin”<<endl;
cin>>y;
cout<<“Enter the price of chocolate”<<endl;
cin>>z;
total_rs=(5x)+(10y);
max_cho=total_rs/z;
cout<<” maximum number of chocolates that Chef can buy for Chefina:"<<max_cho;
return 0;
}
what about this code?
My code
#include <iostream>
using namespace std;
int main() {
int x,y,z,total_rs,max_cho;
cout<<"Enter the number of 5rs coin
<<endl;
cin>>x;
cout<<"Enter the number of 10rs coin"<<endl;
cin>>y;
cout<<"Enter the price of chocolate"<<endl;
cin>>z;
total_rs=(5*x)+(10*y);
max_cho=total_rs/z;
cout<<" maximum number of chocolates that Chef can buy for Chefina:"<<max_cho;
return 0;
}
Learning course: Basic Math using C++
Problem Link: Practice Problem in - CodeChef