0% found this document useful (0 votes)
222 views3 pages

Activity 1.1

The document contains information about a student named Nithiya Darshini studying in class DDT2B. It discusses topic 1.1 on the basic structure of a C++ program. As part of an activity, students are asked to identify the meaning of each item in the C++ program structure by completing Figure B, and then label the items in the sample program in Figure C.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
222 views3 pages

Activity 1.1

The document contains information about a student named Nithiya Darshini studying in class DDT2B. It discusses topic 1.1 on the basic structure of a C++ program. As part of an activity, students are asked to identify the meaning of each item in the C++ program structure by completing Figure B, and then label the items in the sample program in Figure C.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Name : NITHIYA DARSHINI A/P SUKUNARAN

Reg. Number : 01DDT20F1041

Class : DDT2B

Lecturer : PUAN.NOR ANISAH MOHD SAAD

TOPIC 1.0 INTRODUCTION TO FUNDAMENTALS OF PROGRAMMING

SUBTOPIC 1.1 C++ program basic structure

CLO Describe the item in C++ program structure

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:

Terminates the execution of a function and returns control to the


3.Return satements calling function (or to the operating system if you transfer control from the
main function). Execution resumes in the calling function at the point immediately
following the call.
A namespace is a declarative region that provides a scope to the identifiers (the
4.Using namespace names of types, functions, variables, etc) inside it. Namespaces are used to
organize code into logical groups and to prevent name collisions that can occur
especially when your code base includes multiple libraries.
Comments can be used to explain C++ code, and to make it more readable. It can
5.Comment also be used to prevent execution when testing alternative code. Comments can be
singled-lined or multi-lined

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

You might also like