Saved Bookmarks
| 1. |
Given data: Principal amount Rs. 50000Number of years 5Rate of interest 7To find the simple interest of the above mentioned given data. Write a C++ program using inline functions. |
|
Answer» #include using namespace std; inline float simple interest(float p1, float n 1, float r 1) { float sil=(pl*nl*rl)/100; retum(sil); } int main () { float si,p,n,r; cout << “\n Enter the Principle Amount Rs. :”;cin >> p; cout <<“\n Enter the Number of Years :”; cin >> n; cout <<“\n Enter the Rate of Interest :”; cin >> r; si = simple interest(p, n, r); cout << “\n The Simple Interest = Rs.” <<si; return 0; } Output: Enter the Principle Amount Rs. : 50000 Enter the Number of Years : 5 Enter the Rate of Interest : 7 The Simple Interest = Rs. 17500 |
|