12th Standard CBSE Syllabus & Materials
12th Standard CBSE
CBSE 12th Economics Government Budget and the Economy Previous year Question Papers Study Material - QB365 Set A
NEW12th Standard CBSE
CBSE 12th Computer Science Interface Python with MySQL - New Previous year Question Papers Study Material - QB365 Set A
NEW12th Standard CBSE
CBSE 12th Computer Science Database Concept - New Previous year Question Papers Study Material - QB365 Set A
NEW12th Standard CBSE
CBSE 12th Computer Science Data Communication - New Previous year Question Papers Study Material - QB365 Set A
NEW12th Standard CBSE
CBSE 12th Computer Science Data Structures - New Previous year Question Papers Study Material - QB365 Set A
NEW12th Standard CBSE
CBSE 12th Computer Science Functions - New Previous year Question Papers Study Material - QB365 Set A

Published on: 14/12/2018
These papers have been created with the sole purpose of helping the students with their preparations. We hope that these sample papers will help you prepare better for your exams and help you fine-tune your strategies for the board exams.
In this question paper, questions are covered from the chapter Data Structure and Pointers and questions are prepared as per NCERT guidelines. Questions are covered from NCERT solutions and NCERT Exemplar.
The latest sample papers have been designed as per the latest blueprints, syllabus and examination trends. Sample papers should be practiced in examination condition at home or school and also show it to your teachers for checking or compare with the answers provided.
Download CBSE Class 12th Standard CBSE Computer Science question papers, sample papers, important questions, and previous year solved papers in PDF format. Get free study materials, NCERT solutions, and exam preparation resources for Class 12th Standard CBSE Computer Science
Questions + Answers key
Take MCQ Computer Science Test

1.
An array V[15][30] is stored in the memory Location with each of the element occupying 8 bytes, If the base address of V is 5300, Find out the memory location of V[8][12], and V[12][2] if the array is stored along the row.
2.
An array Arr[50][10] is stored in the memory along the row with each of the element occupying 2 bytes.Find out the base address and address of element Arr[20][50], if an element Arr[10][25] is stored at the memory location 10000.
3.
An array p[15][10] is stored along the column in the memory wich each element requiring 4 bytes of storage. if the base address of array P is 1400, find out the location of P[8][5].
4.
Write a function in ALTERSUM (int B[][5], int N, int M) in C++ to find and return the sum of elements from all alternates elements of a two dimensional array starting fromB[0][0].
5.
Write a DSUM() Function in c++ to find sum of diagonal elements of a N*N matrix.
6.
Write a Get1From2() function in c++ to transfer the content from two array FIRST[] and SECOND[] to array ALL[].the even places(0,2,4...) of array ALL[] should get the content from the array First[] and odd places (1,3,5,...) of the array ALL[] should get the content from the array SECOND[].
e.g if the FIRST[]array contain
30,60,90
and the SECOND[] array contains
10,50,80
The ALL[] array should contain
30,10,60,50,90,80
7.
Consider a queue of size 5.Insert elements 2,4,6,8 and then delete first two elements.After deleting, insert 10,12 in the queue.Show the status of Front and Rear in each step.
8.
What do Front and Rear signify in a queue? if in a queue, the Rear points to the Front, how many elements are there in queue?
9.
Write a function in C++ to perform push operation on a synamically allocated stack considering the following:
struct Node
{
int X<Y;
Node *Link;
};
class STACK
{
Node *Top;
public:
STACK(){Top=NULL:}
void PUSH();
void POP();
STACK();
};
10.
Write a function POPBOOK() in C++ to perform delete operation from a dynamic stack,which contains Bno and Title.Consider the following definition of NODE,while writing your C++ code.
struct NODE
{
int Bno;
char Title[20];
NODE *Link;
};
11.
Write a function QDELETE() in C++ to perform delete operation on a Linked Queue, which contains Passenger number and Passenger name.Consider the following definition of node in the code:
struct node
{
long int Pno;
char Pname[20];
node *Link;
};
12.
How wil you know that a linear queue is full?
13.
Suppose a data structure is stored in a circular queue with N memory locations what will be the queue full condition?
14.
Write the output of the following program:
#include<iostream.h>
static int i=100;
void Print(char *p)
{
p="pass";
cout<<"Value is"<<p<,end1;
}
void main()
{
char *q="Best of Luck";
print(q);
cout<<"New value is"<<q;
}
15.
Give the output of the following program(assume all required header files are include in the program).
void main()
{
int array[]={2,3,4,5};
int *arptr=array;
int value=*arptr;
cout<<value<"\n";
value=*arptr++;
cout<<value<"\n";
value=*arptr;
cout<<value<<"\n";
value=*++arptr;
cout<,value<<"\n";
}
16.
Find the output of the following program:
#include<iostream.h>
void main()
{
int Moves[]={11,22,33,44},*Queen;
Queen=Moves;
Moves[2]+=22;
cout<<"Queen@<<*Queen<<end1;
*Queen-=11;|
Queen+=2;
cout<<"Now@"<<*Queen<<end1;
Queen++;
cout<<"Finally@"<<*Queen<<end1;
cout<<"New origine@"<<*Moves[0]<<end1;
}
17.
Find the output of the following program:
#include<iostream.h>
struct score
{
int Year;
float topper;
};
void change9Score *s,int x=20)
{
s->topper=(s->topper+25)-x;
s->Year++;
}
void main()
{
Score Arr[]={{2007,100},{2008,95}};
Score *point=Arr;
chang (point,50);
cout<<Arr[0].year<<"#"Arr[0].topper<<end1;
chang(++point);
cout<<point->Year<<"#"<<Point->topper<<end1;
}
18.
Give the output of the following program segment:(Assume all desired header file(s) are already included)
void main()
{
float *ptr,Ponts[]={20,50,30,40,10};
Ptr=points;
cout<<*ptr<<end1;
ptr+=2;
ponits[2]+=2.5;
cout<<*ptr<<end1;
ptr++;
(*ptr)+=2.5;
cout<<points[3]<<end1;
}
1.
V[R][C] = V[15][30]
R = 15
C = 30
Element size = 8 bytes
ir = 0
jc = 0
B = 5300
Row wise
Address of V[i][j] = B+W[C(I-Ir)+(J-Jc)]
V[8][12] = 5300+8[30(8-0)+(12-0)]
= 5300+2016
= 7316
Address of V[i][j] = B+W[C(I-Ir)+(J-Jc)]
V[12][2] = 5300+8[30(12-0)+(2-0)]
= 5300+2896
= 8196
2.
Number of rows=50
Number of column = 10
Element size = 2
Address of Arr[10][20]=10000
Base address B=?
Lowest column Ic=0
For row-wise allocation
Arr[P][Q] = B+W[C(P-Ir)+(Q-Ic)]
Arr[10][25] = B+2[10(10-0)+(25-0)]
= B+ 2(125)
10000 = B+250
B = 10000-250=9750
Arr[i][j] = B+W[C(i-Ir)+(J-Ic)]]
Arr[20][50] = 9750+2[10(20-0)+(50-0)]
= 9750+2*250=9750+500=10250
3.
P[i][j] = B + W*[i =+ j x Number of row]
p[8][5] = 1400 + 4[8 + 5(15) = 1400+4[75+8]
= 1400 +4[83]
= 1400 + 332 = 1732
4.
int ALTERSUM (int B[][5], int N,int M)
{
int s=0,c=1;
for(int i=0;i<N;i++)
{
if(C%2 !=0)
s = s+B[i][j];
c++;
}
return s;
}
5.
const int N=5;
void DSUM(int A[N][N])
{
int i,j,sum=0;
cout<<"Sum of Diagoanalone ";
for(i=0;i<N;i++)
{
sum += A[i][j];
}
cout<<sum<<" "<<end1;
Sum=0;
cout<<"Sum of Diagonal Two ";
for(i=0;i<N;i++)
{
um += A[i][n-(io+1)]
}
cout<<sum<<" ";
}
6.
void Get1FRom2(int FIRST[],int ECOND[],
{
int ALL[6];
for(j=1,i=0;j
ALL[i] = FIRST[j];
}
for(j=1,i=0;J
ALL[j] = SECOND[i];
}
}
7.
Front=-1
Rear=-1
0 1 2 3 4
After inserting 2,4,6 and 8 in the queue
0 1 2 3 4
| 2 | 4 | 6 | 8 |
After deleting first two elements
0 1 2 3 4
| 6 | 8 |
Front Rear
After inserting 10
0 1 2 3 4
| 6 | 8 | 10 |
Front Rear
When inserting 12,overflow occurs because the queue is full.
8.
In queue, Front stands for beginning of the queue.From Front, element will be deleted.Rear stands for position of the last element of the queue.
From Rear new element will be added in queue.In a queue, if Rear points to the Front then is either empty or is having 1 element.
9.
void STACK::PUSH()
{
Node *ptr=new Node;
cout<<"Enter X and Y for new node:";
cin>>ptr->X>>ptr->Y;
ptr->Link=Top;
Top=ptr;
}
10.
void POPBOOK()
{
cout<<"Deleting the pop element from stack\n";
cout<<"Book no:"<<top->Bno;
cout<<"Book Title:"<<top->Title<<end1;
NODE *temp=top;
top=top->Link;
delete(temp);
}
11.
void QDELETE()
{
if( Front == NULL)
{
cout<<"Stack is empty";
exit(0):
}
else
{
node *temp;
cout<<"Passenger Information\n";
cout<<"Number:"<<Front->Pno<<end1;
cout<<"Name:"<<Front->Pname;
temp = Front;
Front = Front -> Link;
delete temp;
}
}
12.
( )
In a linear queue,if Rear is equal to maximum size then queue is full.
13.
( )
Circular queue will be full if ((front==Rear + 1) (Fornt == 0 && Rear ==N-1))
14.
output
Value is Pass
New value is Best of Luck
15.
output
2
2
3
4
16.
There is an error in last line, i.e. *Moves[0], so theprogram will not run.In case,if there is no subscript in Moves pointer,then the output would be:
Queen@11
Now@55
Finally@44
New origin@0
17.
2008#75
2009#100
18.
Output
20
32.5
42.5
12th Standard CBSE Syllabus & Materials
12th Standard CBSE
CBSE 12th Computer Science Python Revision Tour I - New Previous year Question Papers Study Material - QB365 Set A
NEW12th Standard CBSE
CBSE 12th Business Studies Planning Important Questions And Answers Study Material - QB365 Set A
NEW12th Standard CBSE
CBSE 12th Business Studies Business Environment Important Questions And Answers Study Material - QB365 Set A
NEW12th Standard CBSE
CBSE 12th Business Studies Principles of Management Important Questions And Answers Study Material - QB365 Set A
CBSE 12th Standard CBSE Subjects
CBSE Standards