CBSE Class 12 Computer Science Revision Worksheet Set B

Read and download the CBSE Class 12 Computer Science Revision Worksheet Set B in PDF format. We have provided exhaustive and printable Class 12 Computer Science worksheets for All Chapters, designed by expert teachers. These resources align with the 2025-26 syllabus and examination patterns issued by NCERT, CBSE, and KVS, helping students master all important chapter topics.

Chapter-wise Worksheet for Class 12 Computer Science All Chapters

Students of Class 12 should use this Computer Science practice paper to check their understanding of All Chapters as it includes essential problems and detailed solutions. Regular self-testing with these will help you achieve higher marks in your school tests and final examinations.

Class 12 Computer Science All Chapters Worksheet with Answers

Q1. Write the output of the following program:

#include<iostream.h>

int Execute (int M)

{

if(M%3==0)

return M=3;

else

return M+10;

}

void Output (int B=2)

{

for(int T=0;T<B;T++)

cout<<Execute(T)<<”*”;

cout<<endl;

}

void main()

{

Output(4);

Output();

Output(3);

}

Q2. Write an interactive program in C++ to read the values of three coefficients of quadratic equation (Ax2 + Bx + C=0). Find the roots of the equation and display them on your screen (including complex roots) specifying the nature of roots.

Q1. Differentiate between CALL by reference and CALL by value.

Q2. When will you make a function inline and why?

Q3. Differentiate between a run‐time error and syntax error. Give one example of each.

Q4. What is the difference between global variables and local variables?
Give an example to illustrate the same.

Q5. What would be output by the following segment of C++?
int fact, i;
fact=1;
i=2;
while (i<=6)
fact*=i;
i++;
cout<<fact;

Q6. What output will be produced by following codes?
(a) int i;
i=‐12;
do
{
cout<<i<<endl;
i=i‐1;
}
while(i>0);
(b)int i;
i=‐12;
do
{
cout<<i<<endl;
i=i‐1;
}
while(i<0);

Q7. How is an entry controlled loop different from exit controlled loop?

Q8. What is the similarity and difference between break and continue statements?

Q10. What is the difference between global variables and local variables? Give an example to illustrate the same.

Q1. Distinguish between an object and a class.

Q2. Differentiate between Data hiding and Encapsulation.

Q3. What is base class? What is a derived class? How are these two interrelated.

Q4. Define the following terms: (i) Inheritance (ii) Encapsulation.

Q5. What is polymorphism?

Q6. What is a reference variable? What is its use?

Q7. How is an entry controlled loop different from exit controlled loop?

Q8. What is the similarity and difference between break and continue statements?

Q9. What is an inline function?

Q10. What do you mean by function prototyping? Write down the advantages of function prototypes in C++.

1. a) Answer the questions (i) and (ii) after going through the following class: 
class serial
{
         int serialcode;
         char title[20];
         float duration;
         int no_of_episode;
public:
         serial()                   //function 1
         { duration = 30;
         no_of_episode = 10;
         }
         serial(int d, int noe) //function 2
         { duration = d;
             no_of_episode = noe;
         }
         serial( &s1)          // function3
         { }
         ~serial()          // function 4
         {
                           cout<<”Destroying Object”<<endl;
         }
};
i. Complete definition of function 3
ii. Give example how function1 and function 2 get executed when object is created.
iii. Write an explicit call to function 2

b) Define a class Bank to represent the bank account of a customer with the following
specification 
Private Members:
- Name          of type character array(string)
- Account_no          of type long
- Type_of_account ( S for Saving Account, C for current Account) of type char
- Balance          of type float
Public Members:
A constructor to initialize data members as follows
- Name          NULL
- Account_no          100001
- Type_of_account          ‘S’
- Balance                   1000
A function NewAccount() to input the values of the data members Name,
Account_no, Type_of_account and Balance with following two conditions
• Minimum Balance for Current account is Rs.3000
• Minimum Balance for Saving account is Rs.1000
A function Deposit() to deposit money and update the Balance amount.
A function Withdrawal() to withdraw money. Money can be withdrawn if minimum
balance is as >=1000 for Saving account and >=3000 for Current account.
A function Display() which displays the contents of all the data members for a account.

c) Answer the questions (i) to (iv) based on the following code : 
class PUBLISHER
{
         char pub[12];
         double turnover;
         protected:
         void register( );
         public:
         PUBLISHER( );
         void enter( );
         void display( );
};
class BRANCH
{
         char city[20];
         protected:
         float employees;
         public:
         BRANCH( );
         void haveit( );
         void giveit( );
};
class AUTHOR: public BRANCH, private PUBLISHER
{
         int acode;
         char aname[20];
         float amount;
         public:
         AUTHOR( );
         void start( );
         void show( );
};
i) Write the names of data members, which are accessible from objects belonging to class
AUTHOR.
ii) Write the names of all the member functions which are accessible from objects belonging
to class BRANCH.
iii) Write the names of all the members which are accessible from member functions of class
AUTHOR.
iv) How many bytes will be required by an object belonging to class AUTHOR?

2. Identify the errors with reasonin the following code fragmen . 5
class X {
         int x;
         static int ctr;
         public:
         X( ){x=0;}
         X( int i ) { x = i ; }
         void init ( void )
         { c=ctr=0; }
         inline static void prn ( void )
         {
         prn( );
         cout<<ctr<<x;
         }
         ~X(int a ){}
}; void main( ){ X X, x1,x2; X.init( );};

3. Write the output of the following:
#include<iostream.h>
         class item{
         static int I ;
int no;
         public :
item( )
{
cout<< “DC”<< “ ”;
}
item ( item & x)
{
cout<< “CC”<<” “;
}
void getdata( int aa )
{
no =aa ;
I ++ ;
}
void putdata()
{
cout <<“\n”<< I<<“\n”;
}
~Item()
{
cout<<”Des”<<I-- ;
}
};
int item::I ;
void main( )
{
item a;
item b=a ;
item c;
c=a;
a.getdata(100);
b.getdata(200);
a.getdata(300);
a.putdata();
b.putdata();
c.putdata();
}

4. Observe the following program carefully & choose the correct possible output (if any) from
the options (i) to (iv) 2
# include <iostream.h>
# include <conio.h>
# include <stdlib.h>
void main ()
{
char serial[] = {'E', 'X', 'A', 'M'};
         int number[] = { 69, 66, 67, 68};
         clrscr();
         randomize();
         cout << number[random(3)];
         for (int i = 0; i < 4; i++)
cout << serial[sizeof(int) + random(2) - 1 ];
         getch();
}
outputs:
(i) 67AXXA
(ii) 67AAAM
(iii) 67XXAX
(iv) 69AXXA

1. What is “? “ Operator? Explain with example?

2. What is use of comma operator?

3. What is selection statement in C? Explain.

4. What do you mean by loop? Explain various type of loop statement in C.

5. Write a program in C to find sum of first 10 natural numbers.

6. Write a program in C to check number is odd or even.

7. Write a program in C to find greater number between two numbers, where numbers are entered by user.

8. Write a program in C to find cube of a number where number is entered by user.

9. Write a program in C to print table a number, where numbers is entered by user.

10. Write a program in C to find total marks, percentage and grade of a student on the

CBSE Computer Science Class 12 All Chapters Worksheet

Students can use the practice questions and answers provided above for All Chapters to prepare for their upcoming school tests. This resource is designed by expert teachers as per the latest 2026 syllabus released by CBSE for Class 12. We suggest that Class 12 students solve these questions daily for a strong foundation in Computer Science.

All Chapters Solutions & NCERT Alignment

Our expert teachers have referred to the latest NCERT book for Class 12 Computer Science to create these exercises. After solving the questions you should compare your answers with our detailed solutions as they have been designed by expert teachers. You will understand the correct way to write answers for the CBSE exams. You can also see above MCQ questions for Computer Science to cover every important topic in the chapter.

Class 12 Exam Preparation Strategy

Regular practice of this Class 12 Computer Science study material helps you to be familiar with the most regularly asked exam topics. If you find any topic in All Chapters difficult then you can refer to our NCERT solutions for Class 12 Computer Science. All revision sheets and printable assignments on studiestoday.com are free and updated to help students get better scores in their school examinations.

Where can I download the 2025-26 CBSE printable worksheets for Class 12 Computer Science Chapter All Chapters?

You can download the latest chapter-wise printable worksheets for Class 12 Computer Science Chapter All Chapters for free from StudiesToday.com. These have been made as per the latest CBSE curriculum for this academic year.

Are these Chapter All Chapters Computer Science worksheets based on the new competency-based education (CBE) model?

Yes, Class 12 Computer Science worksheets for Chapter All Chapters focus on activity-based learning and also competency-style questions. This helps students to apply theoretical knowledge to practical scenarios.

Do the Class 12 Computer Science Chapter All Chapters worksheets have answers?

Yes, we have provided solved worksheets for Class 12 Computer Science Chapter All Chapters to help students verify their answers instantly.

Can I print these Chapter All Chapters Computer Science test sheets?

Yes, our Class 12 Computer Science test sheets are mobile-friendly PDFs and can be printed by teachers for classroom.

What is the benefit of solving chapter-wise worksheets for Computer Science Class 12 Chapter All Chapters?

For Chapter All Chapters, regular practice with our worksheets will improve question-handling speed and help students understand all technical terms and diagrams.