-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathOutput_Worksheet_Answers.cpp
53 lines (35 loc) · 1.25 KB
/
Output_Worksheet_Answers.cpp
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
//Written by: Artemis Solomon
//Welcome to C++: Output Worksheet Answers
//Exercise 1:
//What do this program output to the console
#include <iostream> //Header File Library
int main() //Main Function
{ //curly brace
std::cout << "Hello World!"; //std is using the Standard Library
return 0; //Program returns an integer (number) 0 when program is executed completely
} //curly brace
//Answer
//Console prints: Hello World!
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//Exercise 2:
//Insert the correct operator into the blank space
#include <iostream>
int main()
{
std::_____ << "Hello World!";
return 0;
}
//Answer
//cout
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//Exercise 3:
//Write a program that outputs your first name
#include <iostream>
int main()
{
std::cout << "Hello World!" << std::endl;
std::cout << "My Name is <INSERT YOUR NAME HERE>";
return 0;
}
//Answer
//std::cout << "My name is Artemis";