You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#include<iostream>usingnamespacestd;intmain() {
double simpleInterest, principal, rate, time;
cout << "Enter the Principal: ";
cin >> principal;
cout << "Enter the Rate: ";
cin >> rate;
cout << "Enter the Time: ";
cin >> time;
simpleInterest = (principal * time * rate) / 100;
cout << "The simple interest is " << simpleInterest;
return0;
}
Output
> Enter the Principal: 20000> Enter the Rate: 12> Enter the Time: 2.5> The simple interest is
2. Area of circle
#include<iostream>usingnamespacestd;intmain() {
float areaOfCircle, radius;
double pi = 3.14;
cout << "Enter the radius of the circle: ";
cin >> radius;
areaOfCircle = pi * radius * radius;
cout << "The area of the circle is " << areaOfCircle << " cm2";
return0;
}
Output
> Enter the radius of the Circle: 14> The area of the circle is 615.75cm2