-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathOutput_Exercise_Answers.cpp
46 lines (35 loc) · 1.13 KB
/
Output_Exercise_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
//Written by: Artemis Solomon
//Welcome to C++: Output Exercise Answers
//For this exercise you will be writing the entire program.
//Use the same steps from "Hello World!" module.
//Answers will obviously vary but should be written in the same structure
//Exercise 1:
//Write a program that outputs your name and your favorite color.
//Use the operator endl to create a new line.
#include <iostream>
int main()
{
std::cout << "My name is Artemis!" << std::endl;
std::cout << "My favorite color is Orange.";
return 0;
}
//Exercise 2:
//Write a program that outputs a paragraph.
//use endl to format the paragraph into 4 lines.
#include <iostream>
int main()
{
std::cout << "Hello, my name is Artemis." << std::endl;
std::cout << "I am learning how to write programs in C++!" << std::endl;
std::cout << "I have learned how to write my very first program already!" << std::endl;
std::cout << "I wonder what I will get to learn next?";
return 0;
}
//Exercise 3:
//Write a variation of "Hello World!" Practice the different ways to perform outputs.
#include <iostream>
int main()
{
std::cout "Hello" "World" "!";
return 0;
}