-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfriday.cpp
More file actions
59 lines (41 loc) · 1.02 KB
/
friday.cpp
File metadata and controls
59 lines (41 loc) · 1.02 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
//Muhammad Ghazi
//02-20-2015
//Chapter 3
//Program reads in a decimal number and takes the square root and raises number to power of 12 and prints
//Library Files
#include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;
int main()
{
double number, solution1, solution2;
//Initial prompt
cout << "Enter in any number" << endl;
cin >> number;
//Do calcualtions
solution1 = sqrt(number);
solution2 = pow(number, 12.0);
//Print Results
cout << fixed << showpoint << setprecision(3);
cout << "Square Root = " << solution1 << endl;
cout << "Number to Power of 12 = " << solution2 << endl;
return 0;
}
#include <iostream>
#include <cmath>
#include <string>
#include <iomanip>
using namespace std;
int main()
{
int b = 7;
int a = 2;
int y = 4;
float z = 4.4;
cout << a / float(y) << endl;
cout << pow(10, 6) << endl;
cout << y + b%a*a << endl;
cout << y + b % (a*a) << endl;
cout << int(z + 1.5) << endl;
cout << float(a*y - a) << endl;