-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathc ++ objective uses.cpp
More file actions
88 lines (34 loc) · 1.24 KB
/
c ++ objective uses.cpp
File metadata and controls
88 lines (34 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#include <iostream>
#include <conio.h>
#include <iomanip>
using namespace std;
int main ()
{
float num1, num2;
cout << "Enter your numbers for sum :";
cin>> num1>>num2;
cout << showpoint;//for show points
float sum = num1 + num2 ;
cout << setw (30)<< "Your sum is : " << sum ;
cout <<endl;
cout << "Enter your numbers for substitution :";
cin>> num1>>num2;
cout << noshowpoint; //for no show points
float sub = num1 - num2 ;
cout<< setw (30)<< "Your substitution is : " << sub ;
cout <<endl;
cout << "Enter your numbers for multiplication :";
cin>> num1>>num2;
cout <<setprecision (10);
float multi = num1 * num2 ;
cout<< setw (30)<< "Your multiplication is : " << multi ;
cout <<endl;
cout << "Enter your numbers for division :";
cin>> num1>>num2;
cout <<fixed;//use this for count after (.) on setprecision
cout <<setprecision (2) ;
double div = (float) num1 / num2 ; //It's called typecasting . To convert one data type into another !
cout<< setw (30) << "Your division is : " << div;
cout <<endl;
getch();
}