CBSE Class 12 Computer Science 1 Marks HOTs

Refer to CBSE Class 12 Computer Science 1 Marks HOTs. We have provided exhaustive High Order Thinking Skills (HOTS) questions and answers for Class 12 Computer Science All Chapters. Designed for the 2026-27 exam session, these expert-curated analytical questions help students master important concepts and stay aligned with the latest CBSE, NCERT, and KVS curriculum.

High Order Thinking Skills: Class 12 Computer Science All Chapters

Want to boost your grades in Computer Science? Solving Class 12 Computer Science HOTS Questions is a great way to build strong logic. Review the step-by-step answers below to increase your speed and feel fully ready for your Class 12 exams.

Download HOTS: All Chapters (Class 12 Computer Science)

1 Mark Questions

Programming in C++

1. Observe the program segment carefully and answer the question that follows:
class item
{
int item_no;
char item_name[20];
public:
void enterDetail( );
void showDetail( );
int getItem_no( ){ return item_no;}
};
void modify(item x, int y )
{
fstream File;
File.open( “item.dat”, ios::binary | ios::in | ios::out) ;
item i;
int recordsRead = 0, found = 0;
while(!found && File.read((char*) &i , sizeof (i)))
{
recordsRead++;
if(i . getItem_no( ) = = y )
{
_________________________//Missing statement
File.write((char*) &x , sizeof (x));
found = 1;
}
}
if(! found)
cout<<”Record for modification does not exist” ;
File.close() ;
}

If the function modify( ) is supposed to modify a record in the file “ item.dat “, which item_no is y, with the values of item x passed as argument, write the appropriate
statement for the missing statement using seekp( ) or seekg( ), whichever is needed, in the above code that would write the modified record at its proper place.

2. Observe the program segment carefully and answer the question that follows:
class member
{
int member_no;
char member_name[20];
public:
void enterDetail( );
void showDetail( );
int getMember_no( ){ return member_no;}
};
void update(member NEW )
{
fstream File;
File.open( “member.dat”, ios::binary|ios::in|ios::out) ;
member i;
while(File .read((char*) & i , sizeof (i)))
{
if(NEW . getMember_no( ) = = i . getMember_no( ))
{
_________________________//Missing statement
File.write((char*) &NEW , sizeof (NEW));
}
}
File.close() ;
}
If the function update( ) is supposed to modify the member_name field of a record in the file “ member.dat” with the values of member NEW passed as argument, write the
appropriate statement for the missing statement using seekp( ) or seekg( ), whichever is needed, in the above code that would write the modified record at its proper place.

3. Observe the program segment carefully and answer the question that follows:
class item
{
int item_no;
char item_name[20];
public:
void enterDetails( );
void showDetail( );
int getItem_no( ){ return item_no;}
};
void modify(item x )
{
fstream File;
File.open( “item.dat”, _______________ ) ; //parameter missing
item i;
while(File .read((char*) & i , sizeof (i)))
{
if(x . getItem_no( ) = = i . getItem_no( ))
{
File.seekp(File.tellg( ) – sizeof(i));
File.write((char*) &x , sizeof (x));
}
else
File.write((char*) &i , sizeof (i));
}
File.close() ;
}

If the function modify( ) modifies a record in the file “ item.dat “ with the values of item x passed as argument, write the appropriate parameter for the missing parameter in
the above code, so as to modify record at its proper place.

4. Observe the program segment carefully and answer the question that follows:
class member
{
int member_no;
char member_name[20];
public:
void enterDetails( );
void showDetail( );
int getMember_no( ){ return member_no;}
};
void update(member NEW )
{
fstream File;
File.open( “member.dat”, ios::binary|ios::in|ios::out) ;
member i;
while(File .read((char*) & i , sizeof (i)))
{
if(NEW . getMember_no( ) = = i . getMember_no( ))
{
File.seekp( _________ , ios::cur ) //Paremeter Missing
File.write((char*) &NEW , sizeof (NEW));
}
}
File.close() ;
}
If the function update( ) is supposed to modify a record in the file “ member.dat” with the values of member NEW passed as argument, write the appropriate parameter for the
missing parameter in the above code, so as to modify record at its proper place.

5. A file named as “STUDENT.DAT” contains the student records, i.e. objects of class student.
Write the command to open the file to update a student record. (Use suitable stream class and file mode(s).

6. A file named as “STUDENT.DAT” contains the student records, i.e. objects of class student.
Assuming that the file is just opened through the object FILE of fstream class, in the required file mode, write the command to position the put pointer to point to second record from the last record.

7. A file named as “STUDENT.DAT” contains the student records, i.e. objects of class student.
Assuming that the file is just opened through the object FILE of fstream class, in the required file mode, write the command to position the get pointer to point to fifth record from the beginning.

8. Read the code given below and answer the question:
void main( )
{
char ch = ‘A’;
fstream outFile (“data.dat”, ios::out);
outFile<<ch<<ch;
}
If the file contains GOOD before execution, what will be the contents of the file after execution of this code?

9. Observe the program segment carefully and answer the question that follows:
class student
{
int student_no;
char student_name[20];
int mark;
public:
void enterDetail( );
void showDetail( );
void change_mark( ); //Function to change the mark
int getStudent_no( ){ return student_no;}
};
void modify( int y )
{
fstream File;
File.open( “student.dat”, ios::binary|ios::in|ios::out) ;
student i;
int recordsRead = 0, found = 0;
while(!found && File .read((char*) & i , sizeof (i)))
{
recordsRead++;
if(i . getStudent_no( ) = = y )
{
i . change_mark( );
_________________________//Missing statement 1
_________________________//Missing statement 2
found = 1;
}
}
if( found = = 1)
cout<<”Record modified” ;
File.close() ;

}
If the function modify( ) is supposed to change the mark of a student having student_no y in the file “student.dat”, write the missing statements to modify the student record.

10. Observe the program segment carefully and answer the question that follows:
class item
{
int item_no;
char item_name[20];
public:
void enterDetail( );
void showDetail( );
int getItem_no( ){ return item_no;}
};
void modify(item x )
{
fstream File;
File.open( “item.dat”, ios::binary|ios::in|ios::out ) ;
item i;
while(File .read((char*) & i , sizeof (i)))//Statement 1
{
if(x . getItem_no( ) = = i . getItem_no( ))
{
File.seekp(File.tellg( ) – sizeof(i));
File.write((char*) &x , sizeof (x));
}
}
File.close() ;
}
If the function modify( ) modifies a record in the file “ item.dat” with the values of item x passed as argument, rewrite statement 1 in the above code using ios::eof( ) , so as to modify record at its proper place.

2 Marks Questions

Programming in C++

1. What is wrong with the following while loop:
a. int counter = 1; b. int counter = 1;
while ( counter < 100) while ( counter < 100)
{ cout << counter << “\n;
cout << counter << “\n; counter + +;
counter - -;
}

2. What will be the output of following:
void main ( )
{
int val = 10;
cout << val ++ << val << ++ val;
}

Advanced HOTS Questions with Solutions: Class 12 Computer Science All Chapters

About All Chapters HOTS for Class 12 Computer Science

Master core concepts in All Chapters with these targeted Higher Order Thinking Skills (HOTS) problems. Built for Class 12 Computer Science students following the CBSE curriculum, these exercises challenge analytical thinking and improve problem-solving speed.

Verified Solutions for Better Concept Clarity

Each question in this set is mapped directly to the official NCERT book for Class 12. Review the detailed answer keys provided below each problem to verify your solution steps and correct mistakes early.

Additional Revision and Practice Tests

To reinforce your revision after completing these HOTS, try our online Computer Science MCQ test for Class 12. All learning materials on our platform are completely free and updated for the current academic session.

FAQs

Where can I download the latest PDF for CBSE Class 12 Computer Science 1 Marks HOTs?

You can download the teacher-verified PDF for CBSE Class 12 Computer Science 1 Marks HOTs from StudiesToday.com. These questions have been prepared for Class 12 Computer Science to help students learn high-level application and analytical skills required for the 2026-27 exams.

Why are HOTS questions important for the 2026 CBSE exam pattern?

In the 2026 pattern, 50% of the marks are for competency-based questions. Our CBSE Class 12 Computer Science 1 Marks HOTs are to apply basic theory to real-world to help Class 12 students to solve case studies and assertion-reasoning questions in Computer Science.

How do CBSE Class 12 Computer Science 1 Marks HOTs differ from regular textbook questions?

Unlike direct questions that test memory, CBSE Class 12 Computer Science 1 Marks HOTs require out-of-the-box thinking as Class 12 Computer Science HOTS questions focus on understanding data and identifying logical errors.

What is the best way to solve Computer Science HOTS for Class 12?

After reading all conceots in Computer Science, practice CBSE Class 12 Computer Science 1 Marks HOTs by breaking down the problem into smaller logical steps.

Are solutions provided for Class 12 Computer Science HOTS questions?

Yes, we provide detailed, step-by-step solutions for CBSE Class 12 Computer Science 1 Marks HOTs. These solutions highlight the analytical reasoning and logical steps to help students prepare as per CBSE marking scheme.