C++ Online Compiler
Example: C++ program to enter the P, T, R, and calculate it's Simple Interest
C
C++
C#
Java
Python
PHP
main.cpp
STDIN
Run
// C++ program to enter the P, T, R, and calculate it's Simple Interest #include <iostream> using namespace std; int main() { float p, t, r, SI; // p = principal // t = time // r = rate // SI = simple interest cout << "Enter the principal (amount), time, and rate::\n"; cin >> p >> t >> r; // Calculate simple interest SI = (p * t * r) / 100; // Output cout << "\nSimple Interest = " << SI; return 0; }
5 7 9
Output
Clear
ADVERTISEMENTS