Sample Program C++

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

Sample Program 1

Aaron Guillot
CSCI 192
CRN 20658
9:00 10:15 AM
January 23, 2015

Instructions:

Due: Monday, January 26, 2015


From the Sample C++ Programs link at the bottom of the page of
the www.syl9.com webpage for CSCI 192, you are to take each line of code and
explain its purpose and/or usage in the program. This is to be done line by line. You
should have a cover page, instructions page, the assignment and the work cited
page.
No late assignments accepted!!!

Program 1
// A simple C++ program
programmer

Title/comment of purpose of code by

#include <iostream>
to insert a header

Instructs program with preprocessor

using namespace std;


which is standard

Sets the namespace for the function,


character output

int main()

Declares the function main

Begins the function

cout << "Programming is great fun!";


directs what

Identifies the computer monitor, <<


follows to be pushed to the monitor, lastly
programming is great fun is the output

return 0;
}

Ends the function

Works Cited
"Structure of a Program." C++. CPlusPlus, n.d. Web. 21 Jan. 2015.
<http://www.cplusplus.com/doc/tutorial/program_structure/>.

You might also like