Profit of the Day

#include <iostream>
#include<iomanip>
using namespace std;
class profit
{
  public:
  float p;
  profit()
  {
    p=0;
  }
  profit(int income,int expenses)
  {
    p=((float(income)/float(expenses))*100)-100;
    cout<<fixed<<setprecision(2)<<p<<"%";
  }
};
int main() {
  int i,n;
  cin>>i>>n;
profit share(i,n);
 
return 0;
}

4 comments: