CBSE Class XI Computer Science Programming in C++ Concepts

Scroll down to download pdf file

CBSE Class XI Computer Science Programming in C++ Concepts. Learning the important concepts is very important for every student to get better marks in examinations. The concepts should be clear which will help in faster learning. The attached concepts made as per NCERT and CBSE pattern will help the student to understand the chapter and score better marks in the examinations.

Programming in C++

Investigation of Programming Construct in C++.


• to emphasize the programming construct available in C++

 to investigate each and every programming construct emphasizing the situation where they can be used perfectly.

 to demonstrate few working program in C++ using the constructs.

1.1 Why and What of Constructs in C++ programming

1.1.1 : Flow of logic

You have seen in the previous unit that a program is implementation of an algorithm (steps involved in problem solving) using a particular programming language like C , C++ , Java etc. In our case we are using C++ as a high level language (HLL) to code our programs.

A programming language like C++ is having a bundle of programming elements like tokens , identifiers , variables , constants , operator symbols , punctuation symbols etc. (please refer to earlier unit if you have not learnt all these terms.) . All these programming elements helps a programmer to write simple C++ programs as shown below :

program 1.1

// a simple program in C++ to add two integers


void main( )


int a = 0 , b = 0 ;

cout<<”Input two numbers”;

cin>> a>>b;

cout<<”The sum of numbers are: ” << (a+b);


The above program is a very basic program which asks two integer values from user and prints out their sum. In the above program you may observe that various programming elements like:

                         # < ( ) { = , a b << >> int void main ―Input two numbers ― ; are being used.


Students the program above is very simple to be thought , written and executed, but in real industrial programming situation we seldom get such programs to write. There are many complex situation in life where we often need to write programs using few advanced programming elements. Let us investigate few of the real life situations :

a) Ram needs to find out whether any number is divisible by both 3 and 5.

b) A shopkeeper wants to give x % discount on a particular purchase only when the net purchase by his customer exceeds Rs. 1000

c) A teacher wants to calculate the average marks for each of his 40 pupils in a class.

d) Suresh wants to continue his program till he is pressing escape button on keyboard.

Can you program the above programming problems using the programming elements of C++ which you have learn till now ?

Your answer would be probably a NO , because the C++ programming elements which you have studied till now , will only enable you to write simple linear programs , or sequential programs.

1.1.2: Linear Flow

A simple linear program is one which has a linear flow of execution of programming logic /statements. e.g. program 1.1. The logic of program flows ( or better they are termed as control flow) from top to bottom out of set of statements.

Now let us proof the that program 1.1 follows a sequential flow of logic by the following flow chart diagram :


Please click the link below to download pdf file for CBSE Class XI Computer Science Programming in C++ Concepts.


Click on the text For more study material for Computer Science please click here - Computer Science

Latest NCERT & CBSE News

Read the latest news and announcements from NCERT and CBSE below. Important updates relating to your studies which will help you to keep yourself updated with latest happenings in school level education. Keep yourself updated with all latest news and also read articles from teachers which will help you to improve your studies, increase motivation level and promote faster learning

Class 10 and 12 exam 2020 application process for private candidates

CBSE 10th, 12th exam 2020 application process for private candidates begins to apply by 30th Sept at CBSE Board Exam 2020 application begins: The Central Board of Secondary Education (CBSE) has officially started the online application process for the...

Do you think getting a tutor to help your child is a good idea

Yes, getting a tutor is a good idea to help your child. There are many reasons why parents choose tutors for their children. Some parents feel unable to help their children with homework and some don’t have enough time for this. Some think that their children are more...

Tips to find an excellent home tutor for your child

Most parents dream of making their children good at school, college and building a successful career. So, what exactly should your parents do when they find out their child is failing behind? Many depressed parents solve this problem by hiring a tutor. Most of the...

CBSE schools to have sports period daily for classes 1 to 12

All work and no play makes a child dull. Nowadays students have a very hectic schedule so that they cannot take out time to play games and gently start ignoring sports. Therefore, it is the responsibility of schools to include physical education in the curriculum so...

Study in India Short-term curriculum

Short-term curriculum for foreign students under 'Study in India': Yoga Global Planning In order to encourage international students to learn yoga, the Human Resource Development Ministry has decided to introduce training courses under the Modi’s government aspiring ‘...

Top Classroom Challenges According to the Teachers

Teacher plays a major role in our lives in the classrooms. Not only is studying, but the teacher also serves many other roles in the classrooms. A teacher is always a role model for a student who can inspire him to live a better future life. Besides this, life of a...

Studies Today