#include <iostream>
using namespace std;
int main()
{
int x,f;
cin>>x;
if(x>-9 && x<6)
f=x*x*x+2*x-4;
else
f=x-5;
cout<<"f("<<x<<")="<<f<<endl;
return 0;
}
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Verified answer
#include <iostream>
using namespace std;
int main()
{
int x,f;
cin>>x;
if(x>-9 && x<6)
f=x*x*x+2*x-4;
else
f=x-5;
cout<<"f("<<x<<")="<<f<<endl;
return 0;
}