Write a program c and flowchart that asks user to enter 3 nu

Write a program (c++) and flowchart that asks user to enter 3 numbers: a, b and c. Based on them calculate and display the result of one of following expressions:

3pi^(a-c)+ln(a^2+b^2+5) if a^2+b^2>5,

(sin4(a+b)/cos3(a+c) if a2+b2<1,

b-5 otherwise.

For Example:

Value for a: 2

Value for b: -0.5

Value for c: 6.2

The result is: -32

Solution

#include<iostream>

#include<cmath>

using namespace std;

int main()

{

double a,b,c;

cout<<\"\ enter 3 numbers \ value a : \";

cin>>a;

cout<<\"\ value b : \";

cin>>b;

cout<<\"\ value c : \";

cin>>c;

double result;

if(((a*a)+(b*b))>5)

result=pow(3*pi,(a-c))+log(pow(a,2)+pow(b,2)+5);

else if((2*a + (2*b))<1)

result=(sin(4*(a+b)))/(cos(3*(a+c)));

else result=b-5;

cout<<\"\ the result is : \"<<result;

return 0;

}

Write a program (c++) and flowchart that asks user to enter 3 numbers: a, b and c. Based on them calculate and display the result of one of following expression

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site