Yurttas/PL/OOL/Cplusplus/F/07/06/02/00/01/integrate 01.cpp
Jump to navigation
Jump to search
1/*
2 Copyright(C) 2003
3 All Rights Reserved. Salih Yurttas, ZCubes, BitsOfCode Software Systems, Inc..
4
5 Permission to use, copy, modify, and distribute this
6 software and its documentation for EDUCATIONAL purposes
7 and without fee is hereby granted provided that this
8 copyright notice appears in all copies.
9
10 date : September 1, 2003.
11 author : Salih Yurttas.
12
13 purpose : integration of f(x) = x*x;
14
15 integrate_01.cpp
16*/
17
18
19#include <iostream>
20
21using namespace std;
22
23double integrate(const double,
24 const double);
25
26int main(int argc, char* argv[]) {
27
28 double a,
29 b;
30
31 cout << "-> a : ";
32 cin >> a;
33
34 cout << "-> b : ";
35 cin >> b;
36
37 cout << endl;
38
39 double integral = integrate(a,
40 b);
41
42 cout << "integral of f(x) = x*x ";
43 cout << "in between a = ";
44 cout << a;
45 cout << " and b = ";
46 cout << b;
47 cout << " is = ";
48 cout << integral ;
49 cout << endl;
50
51}