Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h>
- using namespace std;
- float integral(float a)
- {
- float s;
- if (0 < a <= 1 || a <= 0)
- {
- if (a <= 0)
- {
- s = 0;
- }
- if(a>0 && a<=1)
- {
- s = a;
- }
- }
- else
- {
- s = pow(a, 3);
- }
- return s;
- }
- int main()
- {
- float a, s;
- cout << "a= "; cin >> a;
- s = integral(a);
- cout<<"∫(a) = " << s <<"\n";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment