Read and download the CBSE Class 12 Computer Science C++ Programming Worksheet in PDF format. We have provided exhaustive and printable Class 12 Computer Science worksheets for C++ Programming, 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 C++ Programming
Students of Class 12 should use this Computer Science practice paper to check their understanding of C++ Programming 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 C++ Programming Worksheet with Answers
1. Write a program to input two numbers m and n and display first m multiples of n.
2. Write a program to input day number of a week and display the corresponding day name.
3. Write a menu driven program to calculate the volume of a cube, cuboid, or cylinder depending upon user’s choice.
4. Write a program to read a string and print out the following :
1) No. of capital alphabets,
2) No. of small alphabets,
3) No. of non-alphabets
5. Write a program to read a string and print it after replacing each of its capital alphabets by the corresponding small alphabet and each small alphabet by its corresponding capital alphabet.
6. Write a program to input 10 elements in an array and then display these elements.
7. Write a program to input 10 elements in an array and then display these elements in reverse order.
8. Write a program to input elements in a 2D array and then display this array in matrix form.
9. Write a program to input elements in a 2D array and then display the sum of main diagonal elements of this array.
10. A class STUDENT has 3 data members:
Name, Roll Number, Marks of 5 subjects, Stream
and member functions to input and display data. It also has a function member to assign stream on the basis of the table given below:
Average Marks Stream
96% or more Computer Science
91% - 95% Electronics
86% - 90% Mechanical
81% - 85% Electrical
75% - 80% Chemical
71% - 75% Civil
Declare a structure STUDENT and define the member functions.
Write a program to define a structure STUDENT and input the marks of n (<=5) students and for each student allot the stream.
11. Define a class student with the following specifications:
Private members of the class:
Admission Number - An Integer
Name - string of 20 characters
Class - Integer
Roll Number - Integer
Public members of the class:
getdata() - To input the data
showdata() - To display the data
Write a program to define an array of 10 objects of this class, input the data in this array and then display this list.
12. Define a class MP in C++ with following description :
Private members :
a. MP name of type string
b. Party name of type string
c. No. of votes received as integer
d. Nomination money as float
Public members :
• A constructor to initialize MP name as NULL, Party name as “Independent” & nomination money as 5000.
• A destructor to destruct MP class object.
• A function INMP( ) to input data for MP.
• A function OUTMP( ) to allow user to view the content of all the data members.
13. Write a program that show the concept of Multiple inheritance.
14. Create a class student with data members name, class, section, roll No. and function members getdata(), printdata(), and promote(). From this class derive a class 'Sr_std' with additional data member stream. Also include another function member change_stream().
Use these classes in a program.
15. Write a program to input the name of a text file from the user and display:
a) The number of blanks present in the file.
b) The number of lines present in the file.
c) The number of capital alphabets present in the file.
d) The number of small alphabets present in the file.
e) The number of lines starting with a capital alphabet.
f) The number of words present in the file.
g) The number of digits present in the file.
h) to count the number of complete words as “to” and “are”
16. Write a program to input the name of a text file from the user. Then input a string and search for the string in the file. The program should an appropriate message if the file with the given name is not present.
17. Write a program to input a text file name, read the contents of the file and create a new file named COPY.TXT, which shall contain only those words from the original file which don’t start with an uppercase vowel (i.e., with ‘A’, ‘E’, ‘I’, ‘O’, ‘U’). For example, if the original file contains
The First Step To Getting The Things You Want Out Of Life is This: Decide What You Want. - Ben Stein
Then the text file COPY.TXT shall contain
The First Step To Getting The Things You Want Life is This: Decide What You Want. - Ben Stein
18. Write an interactive C++ program to open a text file and then display the following:
1) all the alphabetic characters present in the file.
2) Number of numeric characters present in the file.
19. Create a text file (w/o using any C++ program) containing the names of students and their marks in the following format:
Ajay 350
Vijay 340
where name and marks are separated by either a space or a tab and end of line is a record separator. Write a program to read this file and display the records in two columns name and marks. Within the name column, the students' names are to be left justified and marks are to be right justified in the marks column.
20. Declare a structure telerec in C++, containing name (20 characters) and telephone number. Write a program to maintain a file of telephone records. The program should allow the following functions on the file:
1) To append records in the file.
2) Display the name for a given telephone number. If the telephone number does not exist then display error message "record not found".
3) Display the telephone number(s) for a given name. If the name does not exist then display error message "record not found".
21. A blood bank maintains a data file that contains the following information for every donor: Name, Date of Birth, Telephone number, Blood group. Write a program in C++ to do the following:
1) Given a blood group, display name, date of birth and phone number of all the persons of the given blood group.
2) Append records in the file.
3) Input a telephone number and modify the corresponding record.
22. Create two payroll files COMP1.DAT and COMP2.DAT. Each of the files should have the following fields: EmpNo : Integer Name: A string of 20 characters Salary : A floating point no.
Both the files should be created in the increasing order of the EmpNo. Your program should then merge the two files and obtain a third file NEWCOMP.DAT. The program should also display the data from all the three files.Do not use arrays for merging and sorting of the files. You can assume that the EmpNo are unique.
23. Write a menu driven program in C++ to perform the following functions on a binary file “BOOK.DAT” containing objects of the following class:
class Book
{ int BookNo; char Book_name[20];
public: void enterdetails(); void showdetails();
int Rbook_no() {return Book_no;}
int Rbook_name() {return Book_name;}
};
1. Append Records
2. Modify a record for a given book no.
3. Delete a record with a given book no.
4. Search for a record with a given Book name
| CBSE Class 12 Computer Science Revision Worksheet Set A |
| CBSE Class 12 Computer Science Revision Worksheet Set B |
| CBSE Class 12 Computer Science Revision Worksheet Set C |
| CBSE Class 12 Computer Science Boolean Algebra Worksheet Set A |
| CBSE Class 12 Computer Science Boolean Algebra Worksheet Set B |
| CBSE Class 12 Computers Boolean Algebra Worksheet |
| CBSE Class 12 Computer Science C++ Programming Worksheet |
| CBSE Class 12 Computer Science Case Study Based Questions |
| CBSE Class 12 Computer Science Class And Objects Worksheet Set A |
| CBSE Class 12 Computer Science Class And Objects Worksheet Set B |
| CBSE Class 12 Computers Classes And Objects Worksheet |
| CBSE Class 12 Computer Science Classes Objects Constructors And Destructors Worksheet |
| CBSE Class 12 Computer Science Communication And Network Concepts Worksheet |
| CBSE Class 12 Computer Science Computer Networking Worksheet |
| CBSE Class 12 Computer Science Constructors And Destructors Worksheet |
| CBSE Class 12 Computers Constructors And Destructors Worksheet |
| CBSE Class 12 Computer Science Data File Handling Worksheet |
| CBSE Class 12 Computers Data Structures Worksheet |
| CBSE Class 12 Computer Science Database Concepts And Sql Worksheet |
| CBSE Class 12 Computer Science Dbms And Structured Query Language Worksheet |
| CBSE Class 12 Computer Science Flow Of Control Worksheet |
| CBSE Class 12 Computer Science Function And Structures Worksheet |
| CBSE Class 12 Computer Science Function Overloading Worksheet |
| CBSE Class 12 Computer Science Fundamentals Of Computer Worksheet |
| CBSE Class 12 Computer Science Inheritance Extending Classes Worksheet |
| CBSE Class 12 Computer Science Linked Lists Stacks And Queues Worksheet |
| CBSE Class 12 Computer Science Network And Communication Technology Worksheet |
| CBSE Class 12 Computer Science Object Oriented Programming Worksheet |
| CBSE Class 12 Computers Object Oriented Programming Worksheet |
| CBSE Class 12 Computer Science Object Oriented Programming In C++ Worksheet |
| CBSE Class 12 Computer Science Oop Classes And Objects Worksheet |
| CBSE Class 12 Computer Science Programming In C++ Worksheet |
| CBSE Class 12 Computer Science SQL Worksheet Set A |
| CBSE Class 12 Computer Science SQL Worksheet Set B |
| CBSE Class 12 Computer Science Stacks Queues And Linked List Worksheet |
Important Practice Resources for Class 12 Computer Science
CBSE Computer Science Class 12 C++ Programming Worksheet
Students can use the practice questions and answers provided above for C++ Programming 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.
C++ Programming 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 C++ Programming 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.
You can download the latest chapter-wise printable worksheets for Class 12 Computer Science Chapter C++ Programming for free from StudiesToday.com. These have been made as per the latest CBSE curriculum for this academic year.
Yes, Class 12 Computer Science worksheets for Chapter C++ Programming focus on activity-based learning and also competency-style questions. This helps students to apply theoretical knowledge to practical scenarios.
Yes, we have provided solved worksheets for Class 12 Computer Science Chapter C++ Programming to help students verify their answers instantly.
Yes, our Class 12 Computer Science test sheets are mobile-friendly PDFs and can be printed by teachers for classroom.
For Chapter C++ Programming, regular practice with our worksheets will improve question-handling speed and help students understand all technical terms and diagrams.