You are on page 1of 1

8

.// Online C++ compiler to run C++ program online


#include <iostream>
#include <cmath>
using namespace std;
int main() {
// Write C++ code here
cout << "enter any number";
float x,y;
cin>>x;
if(x>0){
cout<<"y=(x^2+5x-20)/sqrt(2x)"<<endl;
y=(x*x+5*x-20)/sqrt(2*x);

cout<<"y="<<y;
}
else if(x<0){
cout<<"x^2+2(5x)-10"<<endl;
y=x*x+2*(5*x)-10;
cout<<y;
}
else
{cout<<"y=0";}

return 0;
}

You might also like