-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
57 lines (39 loc) · 1009 Bytes
/
Copy pathmain.cpp
File metadata and controls
57 lines (39 loc) · 1009 Bytes
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
#include <iostream>
#include <cstdlib>
#include <string>
#include <limits>
#include <vector>
#include <sstream>
#include <numbers>
#include <ctime>
#include <cmath>
using namespace std;
// Global variable
int globalVar = 187;
// A variable that can not be changed on Runtime
const double PI = 3.14159265359;
void printPi() {
//Prints a formatted String
printf("Formatted PI: %.4f", PI);
}
int main(int argc, char** argv) {
// Prints "Hello World!" to console and ends line
cout << "Hello World! " << endl;
string q1 = "Enter a Number : ";
string num1;
//Prints string to console
cout << q1;
// User Input
cin >> num1;
//Convert the string to a Number
int cNum1 = stoi(num1);
// Prints the Number the user has entered
cout << "\nYou entered the Number: " << cNum1 << endl;
// Create a 2D Array
int board[3][3] = {3,3,3,
3,3,3,
3,3,3};
//Prints Pi
printPi();
return 0;
}