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: 03/03/2020
12th Standard computer Science Board Exam Model Question 2019-2020
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.
Write a function in C++ to calculate the average word size in a text file “Report.txt”, each word is separated by single space or full stop.
2.
Rewrite the following program after removing the syntactical error(s) if any. Underline each correction.
#include< iostram.h >
const int Max 10;
void main()
{
int Numbers[Max];
Numbers = {20,50,10,30,40};
for(Loc=Max-1;Loc>=10;Loc--)
cout>>Numbers[Loc];
}
3.
State and verify absorption law using truth table.
4.
Explain the following terms in short:
(i) DHTML
(ii) ISP
5.
An array A[35][15] is stored in the memory along the row with each of the element occupying 4 bytes, find out the base address and address of elemnts A[20][5], if an elementA[2][2] is stored at the memory location 3000.
6.
Write a function in c++ and print the sum of all the values, which are either divisible by 2 or are divisible by 3 present in a two dimensional array passed as the argument to the function.
7.
Verify the following boolean expression using truth table
\((i)\quad X.\overset { - }{ X } =0\\ (ii)\quad X+1=1\)
8.
Rewrite the following program after removing the syntactical errors(if any).Underline each correction.
#include<iostream.h>
class Transport
{
char Model[20];
char Name[20];
void Get( )
{
gets(Model);
gets(Name);
}
void Show( )
{
cout<<Model<<end1;
puts(Name);
}
};
void main( )
{
Transport T;
T.Get( );
Show( );
}
9.
Consider the following relations
Teach (Name, Address, Course)
Give an expression in the relational algebra for each of the following:
(i) Print all the information about teachers who are teaching the 'DBMS' course.
(ii) Print the names and addresses of those teachers who teach 'computer'.
(iii) List all the teachers who live in Mumbai.
10.
Consider the following two tables:
Relation: STUDENTS
| Name | RollNo | Class |
| Saurabh | 349 | 11A |
| Yogendra | 443 | 11B |
| Mohan | 306 | 11A |
| Monika | 259 | 10C |
Relation: VIDHYARTHI
| Name | RollNo | Class |
| Shagun | 150 | 10A |
| Saurabh | 349 | 11A |
Perform the STUDENTS U VIDHYARTHI operation on above relation and show the resultant relation.
11.
What is primary and alternate key in a database? Give a suitable example to explain each.
12.
How precedence of assignment operators related to other operators? What is their associativity?
13.
What is the difference between #define and const? Explain with suitable example.
14.
Differentiate between a run-time error and syntax error. Also, give suitable examples of each in C++.
15.
Write the output of the follwoing program segment
char *NAME="ComPUteR";
for(int x=0;x < strlen(NAME);x++)
if(islower(NAME[x]))
if(x%2==0)
NAME[x]=tolower(NAME[x]));
else
NAME[X]=NAME[x-1];
puts(NAME);
16.
Output of 4 input (x,y,z,w) Boolean function F is 1 when
i) At least two variable have the truth value 1
ii) At least three variable have the truth value 1
iii) Only when the three variable have the truth value 1
Draw the truth table. Solve it by using K map in Product of Sum terms
17.
Solve the following F(a,b,c,d)=∑(0,1,3,4,5,7,8,9,11,12,13,15). Obtain the simplified form using K-Map.
18.
Find the output of the following program:
#include< iostream.h >
void main( )
{
long NUM=1234543;
int F=0,S=0;
do
{
int R=NUM % 10;
f (R %2 != 0)
F += R;
else S += R;
NUM / = 10;
}
while (NUM>0);
cout<< F-s
}
19.
Consider the following stack of characters, where STACK is allocated N = 8 memory cells.
STACK:A,C,D,FK,...........
Desceibe the STACK ath the end of the following operations.Here,
POP and PUSH are algorithms for deleting and addimg an element to the atack.
(a) POP(STACK,ITEM); (b) POP(STACK,ITEM);
(c) PUSH(STACK,L); (d) PUSH(STACK,P);
(e) POP(STACK,ITEM); (f) PUSH(STACK,R);
(g) PUSH(STACH,S); (h) POP(STACK,ITEM);
20.
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";
}
21.
To print the numbers using break statement.
22.
To print the numbers from 1 to 10 with the help of while loop
23.
Write a function in C++ to INSERT operation in a dynamically allocated stack considering the following description. Struct Node
{
float U, V;
Node *Link;
};
class QUEUE
{ Node *Rear, *front;
Public: QUEUE()
{
Rear= NULL;
Front= NULL;
}
void INSERT();
void DELETE();
};
24.
Write a function in C++ to perform a DELETE operation in a dynamically allocated queue considering the following description:
struct Node
{ float U,V;
Node *Link;
};
class QUEUE
{
Node *Rear, *Front;
public: QUEUE( )
{
Rear =NULL; Front= NULL;}
void INSERT ( );
void DELETE ( );
~QUEUE ( );
};
25.
Answer the questions (i) to (iii) based on the following code:
class toys
{
char Code;
char Manufacturer [10];
public: toys( );
void Read_toy_details ( );
void Disp_toy_details( );
};
class electronic :
public toys { int no_of_types;
float cost_of_toy;
public:
void Read_elect_details ( );
void Disp_elect_details ( );
};
class infants :
private electronic
{
int no_of_buyers;
char delivery date[10];
public:
void Read_infant_details ( );
void Disp_jnfant_details( );
};
void main ( )
{ infants MyToy;
}
(a) Mention the member names which are accessible by MyToy declared in main ( ) function.
(b) What is the size of MyToy in bytes?
(c) Mention the names of functions accessible from the member function Read_infant_details () of class printer. (d) Which type of inheritance shown in the above code?
26.
Trine Tech Corporation (TTC) is a professional consultancy company. the company is planning to set up their offices in India with its hub at Hyderabad. As a network advisor, you have to understand their requirement and suggest them the best available solutions. Their queries are mentioned as (i) to (iv) below.
Block to block distance(in m)
| Block (From) | Block(To) | Distance |
|---|---|---|
| Human Resource | Conference | 110 |
| Human Resource | Finance | 40 |
| Conference | Finance | 80 |
Expected number of computers to be in each block
| Block | Computers |
| Human Resource | 25 |
| Finance | 120 |
| Conference | 90 |
(i) Which will be the most appropriate block, where TTC should plan to install their server?
(ii) Draw a block to block cable layout to connect all the building in the most appropriate manner for efficient communication.
(iii) What will be the best possible connectivity out of the following, you will suggest to connect the new setup of offices in Bangalore with its London based office.
(iv) Which of the following device will be suggested by you to connect each computer in each of the buildings?
27.
Write a function in C++ to count the number of "ME" or "MY" words prsent in a text file DIARY.TXT.If the file DIARY.TXT content is as follows: My first book was Me and MY Family. It gave me chance to be known to the world. The count of the function should be Count of Me/My in file:4
28.
Given the following C++ code, answer the question (i) and (ii)
class Testmeout
{
public:
~Testmeout()
{
cout<<"Leaving the examination hall";
cout<<end1;
}
Testmeout()
{
cout<<"Appearing examination hall:;
cout<<end1;
}
void Mynetwork()
{
cout<<"Atempting question"<<end1;
}
};
(i) in object oriented programming, what Function 1 is referred as and when does it get invoked/called?
(ii) in object oriented programming, what Function 2 is referred as and when does it get invoked/called?
29.
Write a function COUT_TO() in C++ to cout the presence of aworld 'to' in text file NOTES.TXT is as it is very important to know that smoking is injurious to health,let us take initiative to stop it.The function COUT_TO()will display the following message cout of-to=in file:3
30.
Write a C++ program to generate and display all the armstrong numbers between 1 and 200.
31.
Answer the questions (a) and (b) on the basis of the following tables SHOPPE and ACCESSORIES.
TABLE SHOPPE
| Id | SName | Area |
| S001 | ABC Computeronics | CP |
| S002 | All Infotech Media | GK II |
| S003 | Tech Shoppe | CP |
| S004 | Geeks Tecno Soft | Nehru Place |
| S005 | Hitech Tech Store | Nehru Place |
TABLE ACCESSORIES
| No | Name | Price | Id |
| A01 | Mother Board | 12000 | S01 |
| A02 | Hard Disk | 5000 | S01 |
| A03 | Keyboard | 500 | S02 |
| A04 | Mouse | 300 | S01 |
| A05 | Mother Board | 13000 | S02 |
| A06 | Keyboard | 400 | S03 |
| A07 | LCD | 6000 | S04 |
| T08 | LCD | 5500 | S05 |
| T09 | Mouse | 350 | S05 |
| T10 | Hard Disk | 4500 | S03 |
(a) Write the SQL queries:
(i) To display Name and price of all the Accessories in ascending order of their price.
(ii) To display id and Sname of all Shoppe located in Nehru place.
(iii) To display Minimum and Maximum price of each Name of Accessories.
(iv) To display Name,Price of all Accessories and their respective SName,where they are available.
(b) Write the output of the following SQL commands;
(i) SELECT DISTINCT NAME FROM ACCESSORIES WHERE PRICE>=5000;
(ii)SELECT AREA.COUNT (*) FROM SHOPPE GROUP BY AREA;
(iii)SELECT COUNT (DISTINCT AREA) FROM SHOPPE;
(iv)SELECT NAME,PRICE*0.05 DISCOUNT FROM ACCESSORIES WHERESNO IN ('S02','S03');
32.
A file named as “EMPLOYEE.DAT” contains the employee records, i.e. objects of class employee.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 fifth record from the last record.
33.
Express \(P+\bar { Q } .R\) in canonical SOP form
34.
State the distributive laws of boolean algebra. How do they differ from the distributive laws of ordinary algebra?
35.
Write the dual of the boolean expression \((A+0).(A.1.\bar { A } )\)
36.
Write the Sum of Product(SOP) form of the function F(A,B,C) for the following truth table representation of F:
| A | B | C | F |
| 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 0 |
| 0 | 1 | 0 | 1 |
| 0 | 1 | 1 | 1 |
| 1 | 0 | 0 | 1 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 0 |
| 1 | 1 | 1 | 1 |
37.
Write the Product of Sum(POS) form of the function F(X, Y, Z) for the following truth table representation of F:
| X | Y | Z | F |
| 0 | 0 | 0 | 1 |
| 0 | 0 | 1 | 0 |
| 0 | 1 | 0 | 0 |
| 0 | 1 | 1 | 1 |
| 1 | 0 | 0 | 0 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 1 |
| 1 | 1 | 1 | 1 |
38.
Give one suitable example of each URL and domain name.
39.
How does firewall protect our network?
40.
What do you mean by spam mails? How can you protect your mailbox from spams?
41.
what term we use for a software/hardware device, which is used to block, unauthorized access while permitting authorized communications? this term is also used for a device configured to permit, deny, encrypt, decrypt, or proxy all(in and out) computer traffic between different security domains based a set of rules and other criteria.
42.
Create a table named PROGRAMMERS with the following structure:
| P_Name | 20 Characters |
| DOJ | Date |
| SAL | NUMBER |
i) Display the name of the programmer, which has the highest salary.
ii) Update the salary of all programmer by 2000 whose name start with letter 'R'.
43.
Write a query on the SALESPEOPLE table, whose output will exclude all salespeople with a rating >=100, unless they are located in Delhi.
44.
Give the SQL statement to create a table STUDENT with Roll Number, Name, Age and Marks.
45.
Differentiate between SQL commands DROP TABLE and DROP VIEW.
46.
What are DDL and DML?
47.
What is the difference between HTTP and FTP?
48.
Suppose a data structure is stored in a circular queue with N memory locations what will be the queue full condition?
49.
An array circular queue[10] of integers exixt,where currently
Rear=0, Front=1
Answer the following questions based on the above given data:
(i) How many values arte there in queue?
(ii) If five valuesare deleted,whatwould be the new value of Front?
50.
Which C++ header file(s) will be essentially required to be included to run/execute the following C++ code?
void main()
{
int Eno_123;
char Ename[]="RehanSwarop";
cout<<setw(5)<<Eno_123<<setw(25)<<EName<<endl;
}
51.
Observe the following C++ code and write the name(s) of the header file(s),which will be essentially required to run it in a C++ compiler.
void main()
{
int Number;
cin>>Number;
if(abs(Number)==Number);
cout<<"Positive"<<endl;
}
52.
How many times is the loop executed?
int i=0, j=0;
do
{
i=j;
}
while(j<5);
53.
How does a compiler decide as to which function should be invoked when there are many functions with the same name?
54.
Why are the functions arguments called as 'Signature'?
55.
Inheritance allows code reusability in OOp.Explain how?
56.
Differentiate between an identifier and keywords.
57.
How are the object's behaviour and object's characteristics represented in OOP?
58.
How 'I' operator is different from '%' operator?
59.
Consider the following tables PRODUCT and CLIENT. Write SQL commands for the statement (a) to (d) and give outputs for SQL queries (e) to (h)
TABLE: PRODUCT
| P_ID | ProductName | Manufacturer | Price |
| TP01 | Talcom Powder | LAK | 40 |
| FW05 | Face Wash | ABC | 45 |
| BS01 | Bath Soap | ABC | 55 |
| SH06 | Shampoo | XYZ | 120 |
| FW12 | Face Wash | XYZ | 95 |
TABLE: CLIENT
| C_ID | Clientname | City | P_ID |
| 01 | Cosmetic Shop | Delhi | FW05 |
| 06 | Total Health | mumbai | BS01 |
| 12 | Live Life | Delhi | SH06 |
| 15 | PrettyWoman | Delhi | FW12 |
| 16 | Dreams | Bengaluru | TP01 |
(a) To display the details of those Clients, whose City is Delhi.
(b) To display the details of products, whose Price is in range of 50 to 100(both values included)
(c) To display the ClientName, City from table CLIENT and Product Name and Price from table PRODUCT, with their corresponding mathing P_ID.
(d) To insert the price of all products by 10.
(e) SELECT DISTINCT City FROM CLIENT;
(f) SELECT Manufacturer, MAX(Price), MIN(pRICE), COUNT(*) FROM PRODUCT GROUP BY Manufacturer;
(g) SELECT ClientName, Manufacturer FROM PRODUCT, CLIENT
WHERE CLIENT.P_ID=PRODUCT.P_ID;
(h) SELECT ProductName,Price*4 FROM PRODUCT;
60.
Write SQL commands for (a) to (f) and write the outputs for (g) on the basis of table STUDENT
TABLE: STUDENT
| SNO | NAME | STREAM | FEES | AGE | SEX |
| 1 | ARUN KUMAR | COMPUTER | 750.00 | 17 | M |
| 2 | DIVYA JENEJA | COMPUTER | 750.00 | 18 | F |
| 3 | KESHAR MEHRA | BIOLOGY | 500.00 | 16 | M |
| 4 | HARISH SINGH | ENG.DR | 350.00 | 18 | M |
| 5 | PRACHI | ECONOMICS | 300.00 | 19 | F |
| 6 | NISHA ARORA | COMPUTER | 750.00 | 15 | F |
| 7 | DEEPAK KUMAR | ECONOMICS | 300.00 | 16 | M |
| 8 | SARIKA VASWANI | BIOLOGY | 500.00 | 15 | F |
(a) List the name of all students, who have taken stream as COMPUTER.
(b) To count the number of female students.
(c) To display the number of students stream wise.
(d) To insert a new row in the STUDENT table
9,'KARISHMA','ECONOMICS',300.18,'F'
(e) To display a report, listing NAME, STREAM,SEX and stipend, where stipend is 20% of fees.
(f) To display all the records in sorted order of name.
(g) Give the output of the following SQL statements based on STUDENT table:
(i) SELECT AVG(FEES) FROM STUDENT WHERE STREAM='COMPUTER';
(ii) SELECT MAX(AGE) FROM STUDENT;
(iii) SELECT COUNT(DISTINCT STREAM) FROM STUDENT;
(iv) SELECT SUM(FEES) FROM STUDENT GROUP BY STREAM;
61.
Given the following tables for a database LIBRARY
TABLE: BOOKS
| Book_Id | Book_Name | Author_Name | Publishers | Price | Type | Qty |
| F0001 | The Tears | William Hopkins | First Publ | 750 | Fiction | 10 |
| F0002 | Thunderbolts | Anna Roberts | First Publ | 700 | Fiction | 5 |
| T0001 | My First C++ | Brain & Broke | EPB | 250 | Text | 10 |
| T0002 | C++ Brainworks | A.m.Rossaine | TDH | 325 | Text | 5 |
| C0001 | Fast Cook | Lata kapoor | EPB | 350 | Cookery | 8 |
TABLE: ISSUED
| BOOK_ID | Quantity _issued |
| F0001 | 3 |
| T0001 | 1 |
| C0001 | 5 |
Write SQL queries for (a) to (f) and output of (g):
(a) To show Book name,Author name and Price of books of EPB publishers.
(b) To list the names from books of Fiction Type.
(c) To display the names and price of the books in descending order of their price.
(d) To increase the price of all books of First Publ Publishers by 50.
(e) To display the Book_Id, Book_Name and Quantity_Issued for all books which have been issued.
(The query will require contents from both the tables.)
(f) To insert a new row in the table ISSUED having the following data 'F0002',4
(g) Give the output of the following queries based on the above tables:
(i) SELECT COUNT(DISTINCT Publishers)FROM BOOKS;
(ii) SELECT SUM(Price) FROM BOOKS WHERE Qty>5;
(iii) SELECT Book_Name,Author_Name FROM BOOKS WHERE Price<500;
(iv) SELECT COUNT(*) FROM BOOKS;
62.
Write the SQL commands for (a) to (f) and write the outputs for SQL queries (g) parts(i) to (iv) on the basis of the table HOSPITAL
TABLE: HOSPITAL
| No | Name | Age | Description | Dateofadm | Charges | Sex |
| 1 | Sandeep | 65 | Surgery | 23/02/98 | 300 | M |
| 2 | Ravin | 24 | Orthopaedic | 20/01/98 | 200 | F |
| 3 | Karan | 45 | Orthopaedic | 19/02/98 | 200 | M |
| 4 | Tarun | 12 | Surgery | 01/01/98 | 300 | M |
| 5 | Zubin | 36 | ENT | 12/01/98 | 250 | M |
| 6 | Ketaki | 16 | ENT | 24/02/98 | 300 | F |
| 7 | Ankita | 29 | Cardiology | 20/02/98 | 800 | F |
| 8 | Zareen | 45 | Gynaecology | 22/02/98 | 300 | F |
| 9 | Kush | 19 | Cardiology | 13/01/98 | 800 | M |
| 10 | Shailya | 31 | Nuclear Medicine | 19/02/98 | 400 | M |
(a) To show all information about the patients of Cardiology Department.
(b) To list the name of female patients, who are in Orthopaedic Department.
(c) To list names of all patients with their date of admission in ascending order.
(d) To display Patient's Name,Charge, Age for male patients only.
(e) To count the number of patients with age>20.
(f) To insert a new row in the hospital table with the following data:
{11,'Mustafa',37,'ENT','25/02/98',250,'M'}
(g) Give the output of following SQL statements
(i) SELECT COUNT(DISTINCT Charges) FROM HOSP[ITAL;
(ii) SELECT MIN(Age) FROM HOSPITAL WHERE Sex='M';
(iii) SELECT SUM(Charges) FROM HOSPITAL WHERE Sex='F';
(iv) SELECT AVG(Charges) FROM HOSPITAL WHERE DaTEofadm<'12/02/98';
63.
Consider the following tables STORE and SUPPLIERS and answer (a) and (b) parts of this questions:
TABLE: STORE
| Item No | Item | Scode | Qty | Rate | LastBuy |
| 2005 | Sharpener Classic | 23 | 60 | 8 | 31-JUN-09 |
| 2003 | Balls | 22 | 50 | 25 | 01-FEB-10 |
| 2002 | Gel Pen Premium | 21 | 150 | 12 | 24-FEB-10 |
| 2006 | Gel Pen Classic | 21 | 250 | 20 | 11-MAR-09 |
| 2001 | Eraser Small | 22 | 220 | 6 | 19-JAN-09 |
| 2004 | Eraser Big | 22 | 110 | 8 | 02-DEC-09 |
| 2009 | Ball Pen 0.5 | 21 | 180 | 18 | 03-NOV-09 |
TABLE: SUPPLIERS
| Scode | Sname |
| 21 | Premimum Stationers |
| 23 | Soft Plastics |
| 22 | Tera Supply |
(a) Write SQL commands for the following statements:
(i) To display details of all the items in the STORE table in ascending order of LastBuy.
(ii)To display ItemNo and Item name of those items from STORE table, whose Rate is more than Rs 15.
(iii) To display the details of those items whose Supplier code(Scode) is 22 or Quantity in store(Qty) is more than 110 from the table STORE.
(iv) To display minimum rate of items for each Supplier individually as per Scode from the table STORE.
(b) Give the output of the following SQL queries:
(i) SELECT COUNT(DISTINCT Scode) FROM STORE;
(ii) SELECT Rate *Qty FROM STORE WHERE ItemNo=2004;
(iii) SELECT Item, Sname FROM STORE S,SUPPLIERS P
WHERE S.Scode=P.Scode AND ItemNo=2006;
(iv) SELECT MAX(LastBuy) FROM STORE;
1.
2.
#include< iostram.h >
const int Max = 10; //Constant Variable ‘Max’ must be
//initialized. Declaration Syntax Error
void main( )
{ int Numbers[Max]={20,50,10,30,40};
for(Loc=Max-1;Loc>=0;Loc--)
cout>>Numbers[Loc];
}
3.
Absorption Law It states that for boolean variable X and Y,
(i) X+X.Y=X (ii) X.(X+Y)=X
Verification:
(i) X+X.Y=X
| X | Y | X.Y | X+X.Y |
| 0 | 0 | 0 | 0 |
| 0 | 1 | 0 | 0 |
| 1 | 0 | 0 | 1 |
| 1 | 1 | 1 | 1 |
Both columns X and X+X.Y are identical.
So, X+X.Y=X Hence Proved.
(ii) X.(X+Y)=X
| X | Y | X+Y | X.(X+Y) |
| 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 1 | 1 |
| 1 | 1 | 1 | 1 |
Both columns X and X.(X+Y) are identical.
So, X.(X+Y)=X Hence Proved.
4.
(i) DHTML DHTML stands for Dynamic HyperText Markup Language. It refers to the web content that changes according to the user request. It will react the user input without sending requests to the web server.
(ii) ISP ISP stands for Internet Service Provider. It refers to the company that provides Internet Services. Some common examples of ISPs are Airtel, BSNL, Tata docomo, etc.
5.
A[R][C] = A[35][15]
R = 35
C = 15
Element size = 4 bytes
ir = 0
jc = 0
A[2][2] = 3000
To find base address B
A[i][j] =B+W[C( I-Ir)+J-Jr)]
A[2][2] = B+4[15(2-0)+(2-0)]
3000 = B+128
B = 3000-128
B = 2872
To find address of A[20][5]
A[20][5] = 2872+4[15(20-0)+(5-0)]
= 2872+1220
= 4092
Arr[2][5] = 4092
6.
void SumArrElements(float A[10][10], int r, int c)
{
int sum = 0;
for(int i=0;i<r;i++)
for(int j=0;j<c;j++)
{
if(A[i][j]%2 == 0|| A[i][j]%3==0)
sum += A[i][j];
}
cout<<"the sum is: "<<sum<<end1;
}
7.
\((i)\quad X.\overset { - }{ X } =0\)
| X | \(\overset { - }{ X } \) | \(X.\overset { - }{ X } \) |
|
0 1 |
1 0 |
0 0 |
\((ii)\quad X+1=1\)
| X | 1 | X+1 |
|
0 1 |
1 1 |
1 1 |
\(\)So, as \((i)\quad X.\overset { - }{ X } =0\\ (ii)\quad X+1=1\) Hence proved
8.
#include<iostream.h>
#include<stdio.h>
class Transport
{
char Model[20];
char Name[20];
public:
void Get( )
{
gets(Model);
gets(Name);
}
void Show( )
{
cout<<Model<<end1;
puts(Name);
}
};
void main( )
{
Transport T;
T.Get( );
T.Show( );
}
9.
\((i){ \sigma }_{ Course="DBMS" }(Teach)\\ (ii){ \Pi }_{ Name,Address }({ \sigma }_{ Course="Computer" })(Teach)\\ (iii){ \sigma }_{ Address="Mumbai" }(Teach)\)
10.
STUDENTS U VIDHYARTHI
| Name | RollNo | Class |
| Saurabh | 349 | 11A |
| Yogendra | 443 | 11B |
| Mohan | 306 | 11A |
| Monika | 259 | 10C |
| Shagun | 150 | 10A |
11.
Primary key It is a column or set of columns which help to identify a row uniquely. e.g. in table student, RollNo of all students are different so, RollNo is a primary key, helps to identify the information of all students uniquely.
Alternate key It is a column or set of columns that can act as a primary key but not selected as a primary key.
Table: Student
| AdmNo | RollNo | Name | Marks |
| 1000 | 1 | Amit | 85 |
| 1200 | 2 | Akash | 65 |
| 999 | 3 | Babita | 95 |
| 1011 | 4 | Charu | 60 |
e.g. In table student, RollNo and AdmNo of all students are different. Both of them can be selected as a primary key. Suppose, we have selected roll number as a primary key then AdmNo is called as an alternate key.
12.
The operators are hierarchically arranged according to their precedence or we can say according to the order of evaluation. Assignment operators like =, +=, -=, #=, /=, etc., have a lower precedence than any of the other operators. Therefore, unary operations, arithmetic operations, relational operations, equality operations and logical operations are all carried out before assignment operations.
Associativity means the order in which consecutive operators within the same precedence group are carried out. The assignment operations have a right to left associativity, which means that the compiler starts on the right of the expression and works towards.
13.
#define preprocessor directive is used to define a macro with some value/expression, which is substituted during compilation of program. Unlike variable, it does not occupy memory. e.g.
#define Max 10
void main()
{
int arr[Max];
}
Const It is used in declaration of variable, it occupies memory to store a constant value, which once initialised cannot be changed
e.g. const int x=10;
14.
Syntax error is that when statements are wrongly written violating rules of the programming language.
e.g. Max + 2 = DMax is a syntax error as an expression cannot appear on the left side of an assignment operator.
Runtime error occurs in a program during its execution. Program execution halts when such an error is encountered.
e.g. division by zero, stack overflow, etc.
15.
16.
17.
18.
2
19.
(a) STACK: A,C,D,F
{K is deleted}
(b) STACK:A,C,D
{F is deleted}
(c) STACK:A,C,D,L
{L is deleted}
(d) STACK:A,C,D,L,P
{P is deleted}
(e) STACK:A,C,D,L
{P is deleted}
(f) STACK:A,C,D,L,R
{R is deleted}
(g) STACK:A,C,D,L,R,S
{S is deleted}
(f) STACK:A,C,D,L,R
{S is deleted}
20.
output
2
2
3
4
21.
#include<iostream.h>
#include<conio.h>
void main()
{
int i;
for(i=1; i<10; i++)
{
cout<<i<<" ";
if(i==4)
break;
}
getch();
} //Loop exit after printing 1 through 4
Output
1 2 3 4
22.
#include<iostream.h>
#include<conio.h>
void main()
{
int count;
count = 1;
while(count<10)
{
cout<<count<<" ";
}
getch();
}
Output
1 2 3 4 5 6 7 8 9 10
23.
24.
Hint : delete node from the beginning
void DELETE( )
{
Node *temp;
if(front==NULL) // No element in the queue
{
cout << " UNDERFLOW..............."
}
else
{ temp=front;
front=front- > Link; // Making the second node as the first one delete temp; // deleting the previous first node.
}
}
25.
26.
(i) TTC should install its server in finance block as it is having a maximum number of computers.
(ii) The above layout is based on maximum cable length required, which is 120 meters in the above case.
(iii) Satellite Link
(iv) Switch.
27.
void count()
{
ifsrream fin("DIARY.TXT");
char word[10];
int C=0;
while(!fin.eof())
{
fin>>word;
word[0]=toupper(word[0]);
if ((strcmp(word,"Me")==0 (strcmp(word,"My")==0))
C++
}
cout<<"Count of Me/My in file:"<
}
28.
(i) Function 1 is referred to as destructor and it gets invoked when an object goes out of scope.
(ii) Function 2 is referred to as destructor and it gets invoked when an object gets created.
29.
void COUNT_TO()
{
ifstream fin("NOTES.TXT");
Char str[10];
int C=0;
while(!fin.eof())
{
fin>>str;str[0]=tolower(str[0]);
if(strcmp(str,"0")==0)
C++;
}
fin.close();
cout<<"Cout of-to-in file:"<
}
30.
#include<iostream.h>
#include<conio.h>
void main()
{
int i,j,k,l;
clrscr();
cout<<"The armstrong numbers in between 1 and 200 are";
for(i=1;i<=200;i++)
{
k=0,j=i;
while(j!=0)
{
l=j;
k=k+1*1*1;
j=j/10;
}
if(k==i)
cout<<"\n"<<i;
}
getch();
}
31.
(a)(i) SELECT Name, Price
FROM ACCESSORIES
ORDER BY Price;
(ii) SELECT Id, SName
FROM SHOPPE
WHERE Area='Nehru Place';|
(iii) SELECT MIN(Price)"Minimum Price",
MAX(Price) "Maximum Price", Name
FROM ACCESSORIES
GROUP BY Name;
(iv) SELECT Name,Price, SName
FROM ACCESSORIES A, SHOPPE S
WHERE A.Id=S.Id;
but this query enable to show the result because A.Id and S.Id are not identical.
(b)(i)
| NAME |
| MotherBoard |
| Hard Disk |
| LCD |
(ii)
| AREA | COUNT(*) |
| GK II | 1 |
| Nehru Place | 2 |
| CP | 2 |
(iii)
| Count(Distinct area) |
| 3 |
(iv) The given query will result in an error as there is no column named SNo in ACCESSORIES table.
32.
( )
File.seekp(-5,ios::end);
33.
( )
\(\Longrightarrow P+\bar { Q } .R\)
\(\Longrightarrow P.(Q+\bar { Q } ).(R+\bar { R } )+(P+\bar { P } ).\bar { Q } .R\)
\(\Longrightarrow (P.Q+P.\bar { Q } ).(R+\bar { R } )+P.\bar { Q } .R+\bar { P } .\bar { Q } .R\)
\(\Longrightarrow R.(P.Q+P.\bar { Q } ).\bar { R } .(P.Q+P.\bar { Q } )+P.\bar { Q } .R+\bar { P } .\bar { Q } .R\)
\(\Longrightarrow P.Q.R+P.\bar { Q } .R+P.Q.\bar { R } +P.\bar { Q } .\bar { R } +P.\bar { Q } .R+\bar { P } .\bar { Q } .R\)
Now, remove duplicate term,
\(\Longrightarrow P.Q.R+P.\bar { Q } .R+P.Q.\bar { R } +P.\bar { Q } .\bar { R } +\bar { P } .\bar { Q } .R\)
34.
( )
Distributive laws of boolean algebra state that:
(i) X.(Y+Z)=X.Y+X.Z
(ii) X+Y.Z=(X+Y).(X+Z)
Law X.(Y+Z)=X.Y+X.Z satisfy ordinary algebra for all values, whereas X+Y.Z=(X+Y).(X+Z) satisfy only for two values (0,1)of X, Y and Z.
35.
( )
Using duality principle, changing (+) to (.) and vice-versa and by replacing 0's with 1's and 1's with 0's, the dual for the given expression is as follows:\((A.1)+(A+0+\bar { A } )\)
36.
( )
| A | B | C | F | Minterms |
| 0 | 0 | 0 | 0 | \(\bar{A}.\bar { B } .\bar { C }\) |
| 0 | 0 | 1 | 0 | \(\bar{A}.\bar { B } .C\) |
| 0 | 1 | 0 | 1 | \(\bar { A } .B.\bar { C }\) |
| 0 | 1 | 1 | 1 | \(\bar { A } .B.C\) |
| 1 | 0 | 0 | 1 | \(A.\bar { B } .\bar { C }\) |
| 1 | 0 | 1 | 0 | \(A.\bar { B } .C\) |
| 1 | 1 | 0 | 0 | \(A.B .\bar { C }\) |
| 1 | 1 | 1 | 1 | A.B.C |
SOP form of function F(A, B, C) is: \(\bar { A } .B.\bar { C } +\bar { A } .B.C+A.\bar { B } .\bar { C } +A.B.C\)
37.
( )
| X | Y | Z | F | Maxterms |
| 0 | 0 | 0 | 1 | X+Y+Z |
| 0 | 0 | 1 | 0 | \(X+Y+\bar { Z } \) |
| 0 | 1 | 0 | 0 | \(X+\bar {Y}+ { Z } \) |
| 0 | 1 | 1 | 1 | \(X+ \bar {Y}+\bar { Z } \) |
| 1 | 0 | 0 | 0 | \(\bar {X}+ Y+Z \) |
| 1 | 0 | 1 | 0 | \(\bar {X}+ Y+\bar { Z } \) |
| 1 | 1 | 0 | 1 | \(\bar {X}+ \bar {Y}+Z \) |
| 1 | 1 | 1 | 1 | \(\bar {X}+ \bar {Y}+\bar { Z } \) |
POS form of function F(X, Y, Z) is: \((X+Y+\bar { Z } ).(X+\bar { Y } +Z).(\bar { X } +Y+Z).(\bar { X } +Y+\bar { Z } )\)
38.
( )
URL http://www.Gabsclasses.com/aboutus
Domain name www.Gabsclasses.com
39.
( )
A firewall is a part of a computer system or network that is designed to block unauthorized access while permitting authorized communications. it is a device or set of devices configured to permit, deny, encrypt, decrypt or proxy all (in and out) computer traffic between different security domains based upon a set of rules and other criteria.
40.
( )
Spam mails, also known as junk E-mails, is a subset of spam that involves nearly identical messages sent to numerous recipients by E-mail. We can protect our mailbox from spams by creating appropriate filters.
41.
( )
Firewall.
42.
( )
i)Select P_Name MAX(SAL) FROM PROGRAMMERS;
ii)UPDATE PROGRAMMERS SET SAL=SAL+2000 WHERE P_NAME LIKE "R%';
43.
( )
SELECT * FROM SALESPEOPLE
WHERE rating<100 or city='Delhi';
SELECT*FROM SALESPEOPLE WHERE NOT rating>=100 OR city ='Delhi';
SELECT*FROM SALESPEOPLE WHERE NOT(rating>=100 AND city<>'Delhi');
44.
( )
CREATE TABLE STUDENT( ROLL Number NUMBER(5) Primary key, Name CHAR(20), Age NUMBER(2), MARKS NUMBER(4));
45.
( )
DROP TABLE command deletes the definition of the table as well as the data of table.If the table is dropped you cannot access it.While DROP VIEW command only deletes the definition of view.Dropping a view does not affect the base table.i.e. no loss of data is there in DROP VIEW.
Syntax of DROP View is - DROP VIEW viewname;
46.
( )
DDL (Data Definition Language) It is a part of SQL, which provides commands for creation,altering and deleting the tables.Different DDL commands are CREATE, ALTER and DROP.
DML (Data Manipulation language) It is a part of SQL, which provides commands for inserting, deleting and updating the information in a database.Different DML commands are SELECT,UPDATE,DELETE,INSERT.
47.
( )
FTP is a protocol used to upload files from a workstation to an FTP server or download files an FTP server to a workstation.
HTTP is a protocol used to transfer files from a web server onto a browser in order to view a web page that is on the Internet.
48.
( )
Circular queue will be full if ((front==Rear + 1) (Fornt == 0 && Rear ==N-1))
49.
( )
(i) 10
(ii) Front = 6
50.
( )
#include<iostream.h> ---->cout
#include<iomanip.h> ----->setw()
51.
( )
iostream.h ----> cin,cout
math.h -------> abs()
52.
( )
Infinite loop because the value of i and j is always equal to zero.
53.
( )
The compiler differentiates between functions with same name by the number of arguments and the data type of arguments that are given with function declaration and the function call.
54.
( )
The arguments differential functions with the same name.The name alone cannot identify a unique function.However, the name and its arguments (signature) will uniquely indentify function.
In real life,also we can see this happening.In a class,two stidents with same name can be indetified by their signature.
55.
( )
Inheritance allows us to add additional features to an existing class without modifying it.Thus,
the class can be raised by inheriting it.We look for a class that can be reused in our program.
If such a class exists,we simple use it or inherit it.Thus , inheritance allows code reusability.
56.
( )
An identifier is the name given by user for a unit of the program.e.g.CHK, Z2TOZ9, etc.
Keywords are the reserved words that convey a special meaning to the language compiler. e.g. auto, break, etc.
57.
( )
An object's behaviours and object's characteristics are represented in terms of member functions of a class and data members of a class.
58.
( )
'I' operator used to find the quotient, whereas '%' operator used to find the remainder.
59.
(a) SELECT * FROM CLIENT WHERE City='Delhi';
(b) SELECT* FROM PRODUCT WHERE Price BETWEEN 50 AND 100;
(c) SELECT ClientName,City,ProductName, Price FROM CLIENT, PRODUCT
WHERE CLIENT.P_ID=PRODUCT.P_ID;
(d) UPDATE PRODUCT SET Price=Price+10
(e)
| DISTINCT City |
| Delhi |
| Mumbai |
| Bengaluru |
(f)
| Manufacturer | Max(Price) | Min(Price) | Count(*) |
| LAK | 40 | 40 | 1 |
| ABC | 55 | 45 | 2 |
| XYZ | 120 | 95 | 2 |
(g)
| Client Name | Manufacturer |
| Cosmetic Shop | ABC |
| Total Health | ABC |
| Live Life | XYZ |
| Pretty Woman | XYZ |
| Dreams | LAK |
(h)
| Product Name | Price*4 |
| Talcom Powder | 160 |
| Face Wash | 180 |
| Bath Soap | 220 |
| Shampoo | 480 |
| Face Wash | 380 |
60.
(a) SELECT NAME FROM STUDEnT WHERE STREAM ='COMPUTER';
(b) SELECT COUNT(*) FROM STUDENT WHERE SEX='F';
(c) SELECT STREAM, COUNT(*) FROM STUDENT GROUP BY STREAM;
(d) INSERT INTO STUDENT VALUES(9,'KARISHMA','ECONOMICS',300.18,'F');
(e) SELECT NAME, STREAM, SEX, FEES*20/100 'STIPEND' FROM STUDENT;
(f) SELECT * FROM STUENT ORDER BY NAME;
(g) The output is given after excluding the row given in part(f).
(i)
| AVG(FEES) |
| 750.00 |
(ii)
| MAX(AGE) |
| 19 |
(iii)
| COUNT(DISTINCT STREAM) |
| 4 |
(iv)
| SUM(FEES) |
| 225.00 |
| 1000.00 |
| 350.00 |
| 600.00 |
61.
(a) SELECT Book_Name,Author_Name,Price FROM BOOKS WHERE Publishers='EPB';
(b) SELECT Book_Name FROM BOOKS WHERE Type='Fiction';
(c) SELECT Book_Name, Price FROM BOOKS ORDER BY Price DESC;
(d) UPDATE BOOKS SET Price=Price+50
WHERE Publishers="First Publ';
(e) SELECT a.Book_Id, a.Book_Name, b.Quantity_Issued FROM BOOKS a, Issued b
WHERE a.Book_Id=b.Book_Id;
(f) INSERT INTO ISSUED VALUES('F0002',4);
(g) The output is given after excluding the row given in part(f)
(i)
| COUNT(DISTINCT Publishers) |
| 3 |
(ii)
| SUM(price) |
| 1350 |
(iii)
| Book_Name | Author_Name |
| My First C++ | Brain & Brooke |
| C++ Brainworks | A.W.Rossaine |
| Fast Cook | lata Kapoor |
(iv)
| COUNT(*) |
| 5 |
62.
(a) SELECT * FROM HOSPITAL WHERE Department='Cardiology';
(b) SELECT NAME FROM HOSPITAL WHERE Department='oRTHOPAEDIC' AND Sex='F';
(c) SELECT NAME FROM HOSPITAL ORDER BY Dateofadm;
(d) SELECT Name, Charges< Age FROM HOSPITAL WHERE Sex='M';
(e) SELECT COUNT(*) FROM HOSPITAL WHERE Age>20;
(f) INSERT INTO HOSPITAL VALUES(11,'Mustafa',37,'ENT','25/02/98',250,'M');
(g) The output is given after excluding the row given in part(f).
(i)
| COUNT(DISTINCT Carges) |
| 5 |
(ii)
| MIN(Age) |
| 12 |
(iii)
| SUM(Charges) |
| 1600 |
(iv)
| AVG(Charge) |
| 387.50 |
63.
(a) (i) SELECT * FROM STORE ORDER BY LastBuy;
(ii) SELECT ItemNo, Item FROM STORE WHREE Rate>15;
(iii) SELECT *FROM STORE WHERE Scode=22 OR Qty>110;
(iv) SELECT MIN(Rate) FROM STORE GROUP BY Scode;
(b)(i)
| COUNT(DISTINCT Scode) |
| 3 |
(ii)
| RATE*Qty |
| 880 |
(iii)
| Item | Sname |
| Gel Pen Classic | Premium Stationers |
(iv)
| Max(LastBuy) |
| 24-FEb-2010 |
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