fork download
  1. #include <cinttypes>
  2. #include <iostream>
  3.  
  4. using std::cin;
  5. using std::cout;
  6.  
  7.  
  8. int main()
  9. {
  10. int16_t i, p, r, t;
  11. cout << "Enter Principal ";
  12. cin >> p;
  13. cout << "Enter Interest rate ";
  14. cin >> r;
  15. cout << "Enter time ";
  16. cin >> t;
  17.  
  18. i = int16_t(p*r*t) / 100;
  19. cout << "Interest= " << i;
  20. }
Success #stdin #stdout 0s 3100KB
stdin
3000
5
4
stdout
Enter Principal Enter Interest rate Enter time Interest= -55