Activity 1.1
Activity 1.1
Class : DDT2B
ACTIVITY 1.1 Students are given a basic c++program as Figure A. Then, student
have to:
1. Identify the meaning/ explanation for each item in c++
program structure. Complete Figure B.
2. Label the c++ program in Figure C with suitable item
Figure A
Activity 1
Figure B
main() function is the entry point of any C++ program. It is the point at which
1.Main function execution of program is started. When a C++ program is executed, the execution
control goes directly to the main() function
In C++ program has the header file which stands for input and output stream used
2.Header file to take input with the help of “cin” and “cout” respectively. There are of 2 types
of header file: Pre-existing header files:
The preprocessors are the directives, which give instructions to the compiler to
6.Preprocessor preprocess the information before actual compilation starts. ... Preprocessor
directives directives are not C++ statements, so they do not end in a semicolon (;).
Blocks begin with a { symbol, end with a } symbol, with the statements to be
7.Begin and end block executed being placed in between. Blocks can be used anywhere a single
statement is allowed. No semicolon is needed at the end of a block.
A simple C++ statement is each of the individual instructions of a program, like the
8.Stament variable declarations and expressions seen in previous sections. They always end
with a semicolon ( ; ), and are executed in the same order in which they appear in a
program.
Header file
Activity 2 Comment
C
A
B Preprocessor directive
D Main function
F
Reserved word
G
Punctuation/Blocks
qqWX