ahmed0saber

Simple integration and differentiation in C++

Nov 4th, 2020
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.84 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5.     float a , b , choose;
  6.     cout << "What do want to do??" << endl << "1-integration" << endl << "2-differentiation" << endl << endl ;
  7.     cin >> choose;
  8.     cout << endl;
  9.     if (choose==1)
  10.     {
  11.         cout << "You are going to use integration of X for a form like this:-" << endl << "aX^b" << endl << endl << "Enter the values of a and b" << endl;
  12.         cout << "a=";
  13.         cin >> a;
  14.         cout << "b=";
  15.         cin >> b;
  16.         cout << endl << "---THE RESULT---" << endl;
  17.         cout << a/(b+1) << "X^" << b+1;
  18.     }
  19.     else if (choose==2)
  20.     {
  21.         cout << "You are going to use differentiation of X for a form like this:-" << endl << "aX^b" << endl << endl << "Enter the values of a and b" << endl;
  22.         cout << "a=";
  23.         cin >> a;
  24.         cout << "b=";
  25.         cin >> b;
  26.         cout << endl << "---THE RESULT---" << endl;
  27.         cout << a*b << "X^" << b-1;
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment