forked from portfoliocourses/cplusplus-example-code
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path05_comments.cpp
More file actions
40 lines (31 loc) · 811 Bytes
/
Copy path05_comments.cpp
File metadata and controls
40 lines (31 loc) · 811 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
/*******************************************************************************
*
* Program: Comments Examples
*
* Description: Examples of using single line and multiline comments in C++.
*
* YouTube Lesson: https://www.youtube.com/watch?v=dKErkyRxPyE
*
* Author: Kevin Browne @ https://portfoliocourses.com
*
*******************************************************************************/
#include <iostream>
using namespace std;
int main()
{
double x, y, sum; // Declare 3 variables
// Prompt the user to enter the two numbers
cout << "Enter two numbers: ";
/*
Accept user input for:
- variable x
- variable y
*/
cin >> x >> y;
// add together x and y
// to produce the sum
sum = x + y;
// sum = y + x;
cout << x << " + " << y << " = " << sum << endl;
return 0;
}