Download Class 12 Computer Science Worksheets for All Chapters
Review targeted practice sets for Class 12 Computer Science All Chapters. Built according to official educational guidelines for the 2026-27 academic year, these downloadable worksheets support daily revision and core concept reinforcement.
Access All Chapters Questions and Exercises
Access the complete worksheet PDF for All Chapters below. Regular practice with these targeted questions builds familiarity with standard exam patterns and helps secure higher marks in final Computer Science evaluations.
1 a. Find the output of the following C++ code considering that the binary file SCHOOLS.DAT exists on the hard disk with the following records of 6 schools of the following class school.
class school
{ int Scode; //School Code
char Sname[20]; //School Name
int nooftr; //Number of Teachers in the school
public:
void Display()
{cout<
int RNOT()
{return nooftr;}
};
void main()
{ fstream SFIN;
SFIN.open(“SCHOOLS.DAT”,ios::binary|ios::in);
school S;
SFIN.seekg(3*sizeof(S));
SFIN.read((char*)&S, sizeof(S));
S.Display();
cout<<”Record :”<
SFIN.close();
}
b. Given a binary file STUDENT.DAT, containing records of the following class student type
class Student
{ char S_Admno[lO]; //Admission number of student
char S_Name[30]; //Name of student
int Percentage; //Marks Percentage of student
public:
void EnterData()
{ gets(S_Admno);
gets(S_Name);
cin>>Percentage; }
void DisplayData()
{ cout<
char * retadmno()
{ return (S_Admno); }
};
Write a function to accept an admission number from user and modify that record in the file.
c. Given a binary file directory.dat containing records of the phone with following structure struct phone
{ char name[20];
char address[30];
char phone[10]; };
Write a function shift_mtnl() in C++ that would display and copy all those records
which are having phone number starting with digit 2 from directory.dat to jio.dat
d. a) Write a difference ios::app and ios::in.
b) What is purpose of tellp() function.
2 a. Find the output for the following code assume all required header files are already included in the program.
Void main ( )
{
int Track [] = {10,20,30,40},*Striker ;
Striker=Track ;
Track [1] += 30 ;
cout<<”Striker”<<*Striker<
*Striker -=10 ;
Striker++;
cout<<”Next @”<<*Striker <
Striker +=2 ;
cout<<”last @”<<*Striker<<’\t’<