fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int total = 300;
  6. int protein = 45;
  7.  
  8. double percent = (double)protein / total * 100;
  9.  
  10. cout << percent << "%" << endl;
  11.  
  12. return 0;
  13. }
Success #stdin #stdout 0.01s 5288KB
stdin
Standard input is empty
stdout
15%