Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "pch.h"
- #include <iostream>
- #include <math.h>
- #include <windows.h>
- #include <conio.h>
- using namespace std;
- void tabulation(float, float, float);
- float func(float);
- void output(float , float);
- int main()
- {
- float a, b, h;
- cout << "Vvedit` a =\t";
- cin >> a;
- cout << "Vvedit` b =\t";
- cin >> b;
- cout << "Vvedit` h =\t";
- cin >> h;
- tabulation(a, b, h);
- return 0;
- }
- void tabulation(float a, float b, float h) {
- float y, p;
- if (a >= b) {
- p = a;
- a = b;
- b = p;
- }
- while (a <= b) {
- y = func(a);
- output(a, y);
- a += h;
- }
- }
- float func(float a) {
- return sqrt(a + 2) - sqrt(a + 3);
- }
- void output(float a, float b) {
- cout << "x = " << a << "\t\t" << "y = " << b << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement