IT 102 - Computer Programming 1: Prepared By: Mr. Johnniephere E. Agravante CITE Instructor
IT 102 - Computer Programming 1: Prepared By: Mr. Johnniephere E. Agravante CITE Instructor
Programming 1
Prepared by: Mr. Johnniephere E. Agravante
CITE Instructor
WEEK 5 – WEEK 8 LESSONS
Lines beginning with a hash sign (#) are directives for the
preprocessor. They are not regular code lines with expressions
but indications for the compiler's preprocessor. In this case
the directive #include <iostream> tells the preprocessor to
include the iostream standard file. This specific file
(iostream) includes the declarations of the basic standard
input-output library in C++, and it is included because its
functionality is going to be used in the program.
using namespace std;
int main ()
{
cout << " Hello int main () { cout << "Hello World!"; return 0; }
World!";
return 0;
}
EXAMPLE C++ PROGRAM:
int main () { cout << " Hello World! "; cout << " I'm a C++ program "; return 0; }
OR
int main ()
{
cout << "Hello World!";
cout << "I'm a C++ program";
return 0;
}
COMMENTS
// line comment
/* block comment */
C++ PROGRAM:
a = 5;
b = 2;
a = a + 1;
result = a - b;
WHAT IS AN IDENTIFIER?
Code:: Blocks
Eclipse
CodeLite
NetBeans