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 CBSE Computer Science Public Exam Model Question 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 count the number of alphabets present in a text file “NOTES.TXT”.
2.
Write the output of the following program:
#include< iostram.h >
#include< conio.h >
void main( )
{
clrscr( );
int a =32;
int *ptr = &a;
char ch = 'A';
char *cho=&ch;
*cho+=a;
*ptr += ch;
cout<< a << "" << ch << endl;
}
3.
Explain the following terms in short:
(i) DHTML
(ii) ISP
4.
An array A[15][20] is stored in the memory along the row with each of the element occupying 4 bytes. Find out the base address and address of element A[3][2], is stored at the memory location 1500.
5.
Write a function in c++, with accept an integer array and its size as parameters and rearrange the array in reverse order.
e.g
if an array contain the elements as
4,2,5,1,6,7,8,12,10
then the function should rearrange the array as
10,12,8,7,6,1,5,2,4
6.
Verify the following using boolean laws:
\(A+C=A+\overset { - }{ A } .C+B.C\)
7.
What is copy constructor? Give an example in C++ to illustrate copy constructor.
8.
Explain the concept of cartesian product between two tables, with the help of an appropriate example.
9.
Explain the concept union between two tables, with the help of appropriate example.
10.
What is the purpose of using a typedef command in C++? Explain with suitable example.
11.
Write the output of the following program.
Void main()
{
int x=5, y=5;
cout<<x--;
cout<<",";
cout<<--x;
cout<<",";
cout<<y--<<","<<--y;
}
12.
What is the difference between automatic conversion and type casting? Also, give a suitable C++ code to illustrate both
13.
Assuming a binary file “BOOK.DAT” contains objects belonging to class book, write a user defined function to add more records to the end of it
14.
Obtain a simplified form for a boolean expression F(U,V,W,Z)= (0,1,3,5,6,7,10,14,15)
15.
Reduce the following Boolean Expression using K-Map:
F(A,B,C,D)= \(\Sigma \)(0,1,2,4,5,6,8,10)
16.
Give the output of the following program:
void main( )
{ int x [ ] = { 10, 20, 30, 40, 50};
int *p, **q, *t;
p = x;
t = x + 1; q = &t;
cout << *p << “\t” << **q << “\t” << *t++;
17.
Evaluate the following postfix expression using a stack and show the contents after execution of each operation:
100,40,8,+,20,10,-,+,*/
18.
Change the following infix expression into postfix expression:
(A+B)*C+D/E-F
19.
To illustrate the concept of passing entire structure as function argument using pass by reference.
20.
To enter a number and display it in from of alphabet with the help of switch statement.
21.
Define a class Serial in C++ with the following specifications:
Private members of class Serial
i). Serialcode integer
ii). Title 20 characters
iii) Duration float
iv) Noofepisodes integers
Public member function of class Serial
i)A constructor function to initialize Duration as 30 and noofepisodes as 10
ii) Newserial function to accept values for serialcode and Title.
iii) Otherenteries( ) function to assign the values of Duration and Noofepisodes with the help of corresponding values passed as parameters to this function. Dispdata( ) function to display all the data members on the screen
22.
An array Arr[50[100] is stored in the memory along the row with each element occupying 2 bytes. Find out the address of the location ARR[20][50] if location of Arr[20][30] is 1350
23.
Write a function in C++, which accepts an integer array and its size as parameters and rearrange the array in reverse. Example if an array of five members initially contains the elements as
6,7,8,13,9,19
Then the function should rearrange the array as 19,9,13,8,7,6 2 Write a function in C++, which accept an integer array and its size as
24.
Consider the following C++ declaration and answer the question given below:
class Alpha
{
int x, y;
protected:
void PutValA()
public:
void GetValA();
};
class Beta : private Alpha
{
int m, n;
protected:
void PutValB()
public:
void GetValB();
};
class Gamma : protected Beta
{
int a:
public:
void GetData();
void ShowData();
};
(i) Write name of member function, wgich are accessible from the objects of class Gamma.
(ii) Write the name of the data members, which are accessible from the member function of class Beta.
(iii) Name the base class and the derived class of class Beta
(iv) Name the base class and derived class of class Gamma
25.
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?
26.
Write a function to count the member of words prsent in a text file named PAPER.TXT.Assume that each word is separated by a single blank/space in the beginning and end of the file.
27.
Write a function in C++ to count number of uppercase alphabets prsent in a text file ARTICLE.TXT.
28.
Write a program to print the following output after inputting the value of n. The user should be prompted again for the value of n, if the inputted value does not lie between 1 to 6 do the inclusive.
1
1 2 3
1 2 3 4 5
1 2 3 4 5 6 7
- - - - - - -
1 2 - - - - - - (2n-1)
29.
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');
30.
Write a program in C++ to print first 10 multiples of an integer N, where N is to be entered by user:
31.
A file named as “EMPLOYEE.DAT” contains the student 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 get
32.
How many input combinations can be there in the truth table of a logic system having(N) input binary variables?
33.
Find the complement of the following boolean function \({ F }_{ 1 }=A.B+\bar { C } .\bar { D } \) :
34.
Give the dual of the boolean function \(\bar { X } .(Y+Z)+\bar { X } .(\bar { Y } +\bar { Z } )\)
35.
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 |
36.
Write the Sum of Product(SOP) form of the function F(P,Q, R) for the following truth table representation of F:
| P | Q | R | 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 |
37.
What is the difference between trojan and virus in terms of computer?
38.
Expand the following abbreviations:
(i) HTTP (ii) VoIP
39.
What out of the following you will use to have an audio visual chat with an expert sitting a far away place to fix-up technical issues?
(i) E-mail (ii) Volp
(iii) FTP
40.
Expand the following :
(i) GPRS
(ii) CDMA
(iii) GSM
41.
What is modem?
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.
How wil you know that a linear queue is full?
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.
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;
}
51.
What is the effect of absence of break in switch-case statement?
52.
How does a compiler decide as to which function should be invoked when there are many functions with the same name?
53.
How an object differs from a program module?
54.
Which function is called during each function call in the program given below?
int sum(int); //Function[I]
float sum(float); //Function[II]
double sum(double); //Function[III}
void main()
{
int x=20;
int a=sum(x); //call1
float b=sum(x); //call2
double c=sum(x); //call3
getch();
}
55.
Is this possible to declare two functions with same name and same argument but different return type in C++?
56.
Evaluate the following C++ expression for x=10, y=5 and z=11
(x==y)||(!(z==y))&&(z<x)
57.
What is wrong with the following C++ statement?
long float y;
58.
Evaluate the following C++ expressions, where a,b and c are integers and d,f are floating point numbers. The values are: a=5,b=3 and d=1.5
i) c=a-(b++)*(--d)
ii)f=(++b)*b-a
59.
Write SQL commands for (a) to (g) on the basis of the table SPORTS
TABLE: SPORTS
| STUDENTNO | CLASS | NAME | GAME1 | GRADE | GAME2 | GRADE1 |
| 10 | 7 | Sameer | Cricket | B | Swimming | A |
| 11 | 8 | Sujit | Tennis | A | Skating | C |
| 12 | 7 | Kamal | Swimming | B | Football | B |
| 13 | 7 | Veena | Tennis | C | Tennis | A |
| 14 | 9 | Archana | Basketball | A | Cricket | A |
| 15 | 10 | Arpit | Cricket | A | Atheletics | C |
(a) Display the names of the students, who have grade 'C' in either GAME1 or GAME2 or both.
(b) Display the number of students getting grade'A' in cricket.
(c) Display the names of the students who have same game for both GAME1 and GAME2.
(d) Display the games taken up by the students, whose name starts with 'A'.
(e) Add a new column names MARKS.
(f) Assign a value 200 for Marks for all those who are getting grade 'B' or grade 'A' in both GAME1 and GAME2.
(g) arrange the whole table in the alphabetical order of NAME.
60.
Given the following family relation. Write SQL commands for questions (a) to (f) and output of (g) based on the table FAMILY
TABLE: FAMILY
| NO | NAME | FEMALE MEMBERS | MALEMEMBERS | INCOME | OCCUPATION |
| 1 | Mishra | 3 | 2 | 7000 | Service |
| 2 | Gupta | 4 | 1 | 50000 | Business |
| 3 | Khan | 6 | 3 | 8000 | Mixed |
| 4 | Chaddha | 2 | 2 | 25000 | Business |
| 5 | Yadav | 7 | 2 | 20000 | Mixed |
| 6 | Joshi | 3 | 2 | 14000 | Service |
| 7 | Mayura | 6 | 3 | 5000 | Farming |
| 8 | Rao | 5 | 2 | 10000 | Service |
(a) To select all the information of family, whose Occupation is service.
(b) To list the name of family, where female members are more than 3.
(c) To list all names of family with income in ascending order.
(d) To display family's name, male members and occupation of business family.
(e) To count the number of family, whose income is less than 10,000.
(f) To insert a new record in the FAMILY table with the following data
9,"D'SOUZA",2,1,15000,"Service"
(g) Give the output of the following SQL commands
(i) SELECT MIN(DISTINCT Income) FROM FAMILY;
(ii) SELECT MIN(FemaleMembers) FROM FAMILY WHERE Occupation='Mixed';
(iii) SELECT SUM(Income) FROM FAMILY WHERE Occupation='Service';
(iv) SELECT AVG(Income) FROM FAMILY;
61.
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;
62.
Consider the following tables STUDENT and STREAM. Write SQL commands for the statements(a) to (d) and give outputs for SQL queries (e) to (h).
TABLE: STUDENT
| SCODE | NAME | AGE | STRCDE | POINTS | GRADE |
| 101 | Amit | 16 | 1 | 6 | NULL |
| 102 | Arjun | 13 | 3 | 4 | NULL |
| 103 | Zaheer | 14 | 2 | 1 | NULL |
| 105 | Gagan | 15 | 5 | 2 | NULL |
| 108 | Kumar | 13 | 6 | 8 | NULL |
| 109 | Rajesh | 17 | 5 | 8 | NULL |
| 110 | Naveen | 13 | 3 | 9 | NULL |
| 113 | Ajay | 16 | 2 | 3 | NULL |
| 115 | Kapil | 14 | 3 | 2 | NULL |
| 120 | Gurdeep | 15 | 2 | 6 | NULL |
TABLE: STREAM
| STRDE | STRNAME |
| 1 | SCIENCE+COMP |
| 2 | SCIENCE+BIO |
| 3 | SCIENCE+ECO |
| 4 | COMMERCE+MATHS |
| 5 | COMMERCE+SOCIO |
| 6 | ARTS+MATHS |
| 7 | ARTS+SOCIO |
(a) To display the name of streams in alphabetical order from table STREAM.
(b) To display the number of students whose POINTS are more than 5.
(c) To update GRADE to 'A' for all those students, who are getting more than 8 as POINTS.
(d) ARTS+MATHS stream is no more available. Make necesary change in table STREAM.
(e) SELECT SUM(POINTS) FROM STUDENT WHERE AGE>14;
(f) SELECT STRCDE, MAX(POINTS) FROM STUDENT GROUP BY STRCDE HAVING SCODE BETWEEN 105 AND 130;
(g) SELECT AVG(AGE) FROM STUDENT WHERE SCODE IN(102,105,110,120);
(h) SELECT COUNT(STRNAME) FROM STREAM WHERE STRNAME LIKE "SCI%";
63.
Consider the following tables CUSTOMER and ONLINESHOP.Write SQL commands for the statements (a) to (d) and give outputs for SQL queries(e) to (h).
TABLE: CUSTOMER
| CID | CNAME | GENDER | SID | AREA |
| 1001 | R SHARMA | FEMALE | 101 | NORTH |
| 1002 | M R TIWARY | MALE | 102 | SOUTH |
| 1003 | M K KHAN | MALE | 103 | EAST |
| 1004 | A K SINGH | MALE | 102 | EAST |
| 1005 | S SEN | FEMALE | 101 | WEST |
| 1006 | R DUBEY | MALE | 104 | NORTH |
| 1007 | M AGARWAL | FEMALE | 104 | NORTH |
| 1008 | S DAS | FEMALE | 103 | SOUTH |
| 1009 | R K PATIL | MALE | 102 | NORTH |
| 1010 | N KRISHNA MURTY | MALE | 102 | SOUTH |
TABLE: ONLINESHOP
| SID | SHOP |
| 101 | MY BUY |
| 102 | ECO BUY |
| 103 | JUST SHOPPING |
| 104 | SHOPPING EASY |
(a) To display CNAME, AREA of all female customers from CUSTOMER table.
(b) To display the details of all the CUSTOMERS in ascending order of CNAME within SID.
(c) To display the total number of customers for each AREA from CUSTOMER table.
(d) to display CNAME and corres[ponding SHOP from CUSTOMER table and ONLINESHOP table.
(e) SELECT COUNT(*), GENDER FROM CUSTOMER GROUP BY GENDER;
(f) SELECT COUNT(*) FROM ONLINESHOP;
(g) SELECT CNAME FROM CUSTOMER WHERE CNAME LIKE 'L%';
(h) SELECT DISTINCT AREA FROM CUSTOMER;
1.
void CountAlphabet()
{
ifstream FIL(“NOTES.TXT”);
int CALPHA=0;
char CH=FIL.get();
while (FIL)
{
if (isalpha(CH)) CALPHA++;
CH=FIL.get();
}
cout<<”No. of Alphabets:”<< CALPHA << endl;
Fil.close ( );
}
2.
129a
ch =97 ( from *cho+=a)
*ptr+=ch
*ptr= *ptr+ch
= 32+ ‘a’ (Character a)
=32+97
=129
Since *ptr or variable a both are same so variable a =129 and ch = ‘a’
3.
(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.
4.
A[R][C] = A[15][20]
R = 15
C = 20
Element size = 4 bytes
ir = 0
jc = 0
A[5][2] = 1500
To find base address B
A[I][J] = B+W[C(I-Ir)+(J-Jc)]
|A[5][2] = B+4[20(5-0)+(2-0)]
1500 = B+408
B = 1500-408
B = 1092
To find address of A[3][2]],
A[3][2] = 1092+4[20(3-0)+(2-0)]
= 1902 + 248
= 1340
5.
void RevArray(int A[],int size)
{
int i=0, j=ize-1,temp;
for(; i<=j; i++,j--)
{
temp = A[i];
A[i] = A[j];
A{j} = temp;
}
}
6.
\(A+C=A+\overset { - }{ A } .C+B.C\)
RHS=\(A+\overset { - }{ A } .C+B.C\)
\(A+C=A+\overset { - }{ A } .C+B.C\\ \quad \quad \quad \quad =(A.\overset { - }{ A } ).(A+C)+B.C\\ \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad [By\quad using\quad distributive\quad law]\\ \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad [By\quad using\quad A+\overset { - }{ A } =1]\\ \quad \quad \quad \quad =1.(A+C)+B.C\\ \quad \quad \quad \quad =A+C+B.C=A+C.(1+B)\\ \quad \quad \quad \quad =A+C.(1)=A+C\quad \quad \quad \quad \quad \quad \quad \quad \quad \quad [\therefore 1+B=1]\\ \quad \quad \quad \quad =LHS\)
7.
Copy constructor A copy constructor is that constructor which is used to initialise one object with the values from another object of same class during declaration.
e.g.
class Student
{
int s ;
public:
Student ( ) / /Default constructor
{
s = 10;
}
};
void main ( )
{
Student sl;
/ /Default constructor called
student s2 (s1) ;
/ /Copy constructor called
}
8.
The cartesian product of two relations R and S is the relation, which is a concatenation of every tuple of relation R with every tuple of relation S.
e.g. consider the following two tables GABS1 and GABS2
Table: GABS1
| RollNo | Name |
| 1 | ABC |
| 2 | GABS |
Table: GABS2
| Marks | SRollNo | Age |
| 90 | 1 | 19 |
| 92 | 3 | 17 |
The cartesian product of both tables is as follows:
\(GABS1\times GABS2\)
| RollNo | Name | Marks | SRollNo | Age |
| 1 | ABC | 90 | 1 | 19 |
| 1 | ABC | 92 | 3 | 17 |
| 2 | GABS | 90 | 1 | 19 |
| 2 | GABS | 92 | 3 | 17 |
9.
In database management system, union of two tables is simply a set operation.While performing union operation on two tables the records, which are common in both the tables appear once in the resultant table and all the other records from both the tables appear once in the resultant table and all the other records from both the tables are also included in the resultant relation. For performing a union between two tables both the tables must be union-compatible.
Tables are said to be union-compatible, if:
(i)Both the tables are of the same degree.
(ii)The domains of corresponding attributes in both the tables should be same.
e.g.Consider the following two tables Course1 and Course2
Table: Course1
| CourseID | CourseName |
| C001 | Computer |
| C002 | Science |
| C003 | Math |
Table: Course2
| CourseID | CourseName |
| C002 | Science |
| C003 | Math |
| C004 | Accounts |
The union of both tables is as follows:
Table:\(Course1\bigcup { Course2 } \)
| CourseID | CourseName |
| C001 | Computer |
| C002 | Science |
| C003 | Math |
| C004 | Accounts |
10.
typedef keyword is used to assign alternative names to existing data types.
e.g. typedef int in;
Now, whenever we want to declare a variable of types integer, rather than using int, we can use 'in' keyword in place.
e.g. void main()
{
typedef int in;
//in is an alternetive name to int
in a=10;
cout<<a; // a is of type integer
11.
The output is 5, 3, 4, 4
12.
Type casting It is used by the programmer to convert value of one type to another type. It is forced type conversion. It is done by putting the target datatype in parentheses before the data to be converted.
e.g. float X=(double)15/6);
Automatic type conversion It is automatically done by the compiler itself wherever required. It is implicit type conversion
e.g. float X=3;
13.
14.
15.
F(A,B,C,D)=A'C'+A'D'+B'D'
16.
3. 10 20 30 Explanation: here 3 pointer variables p, q and t. p=x means p contains base address i.e. address of first element of array x. t = x+1 means t contains address of second element i.e. address of second element i.e. address of 20.
q =&t means q contains address of t.
cout << *p << “\t” << **q << “\t” << *t++;
In this expression Evaluation will start from right to left. *t++ means first print the value stored at the address pointed by t i.e. Value of second element i.e. 20. after that the address pointed by t will be incremented 1 int. ( 2 bytes). Now t will contain the address of 30. Since q contains address of t so *q will give the address of t. therefore **q will give 30.
17.
The stack operation is:
| Scanned Elements | Operation | Stack Status |
| 100 | PUSH 100 | 100 |
| 40 | PUSH 40 | 100,40 |
| 8 | PUSH 8 | 100,40,8 |
| + | POP 8 AND POP 40 calculate 40+8=48 PUSH 48 |
100,48 |
| 20 | PUSH 20 | 100,48,20 |
| 10 | PUSH 10 | 100,48,20,10 |
| - | POP 10 and POP 20 calculate 20-10=10 PUSH 10 |
100,48,10 |
| + | POP 10 and POP 48 calculate 48+10=58 PUSH 58 |
100,58 |
| * | POP 58 and POP 100 calculate 58*100=5800 PUSH 5800 |
5800 |
18.
Let us rewrite like((A+B)*C+D/E-F)
| Scanned Elements | Operation | Stack Status |
| ( | ( | |
| ( | (( | |
| A | (( | A |
| + | ((+ | A |
| B | ((+ | AB |
| ) | ( | AB+ |
| * | (* | AB+ |
| C | (* | AB+C |
| + | (+ | AB+C* |
| D | (+ | AB+C*D |
| / | (+/ | AB+C*D |
| E | (+/ | AB+C*DE |
| - | (- | AB+C*DE/+ |
| F | (- | AB+C*DE/+F |
| ) | AB+C*DE/+F- |
Output AB+C*DE/+F-
19.
#include<iostream.h>
#include<conio.h>
struct students_record
{
int s_rollno,s_class;
};
void display(struct students_record*s1);
void main()
{
struct students_record s1;
s1.s_rollno=14;
s1.s_class=2;
display(&s1);
getch();
}
void display(struct students_record *s1)
{
cout<<"\nRoll no: "<<s1->s_rollno;
cout<<"\nClass: "<<s1->s_class;
}
Output
Roll no:14
Class:2
20.
#include<iostream.h>
#include<conio.h>
void main()
{
int number;
cout<<"Enter a number";
cin>>number;
switch(number);
{
case 1:
cout<<"ONE";
break;
case 2:
cout<<"TWO";
break;
case 3:
cout<<"THREE";
break;
default:
cout<<"Number does not exist";
}
getch();
)
Output
Enter a number 2
TWO
21.
22.
23.
. 6 7 8 13 9 19
Reversing means swap first element and last element, second first element and second last element and so on.
void ReverseArray(int x[], int N)
{
int i,j,temp;
/* i for taking the elements from the beginning onwards, so initialize it with 0 and increment its value(i++). j for taking the elements from the end, so initialize it with N-1 and decrement its value each time (j--) */
for(i=0,j=N-1;ii < N/2;i++j--)
{
temp=x[i]
x[i]=x[j};
x[j]=temp;
}
cout << " After reversing the Arrau elements are " <<endl;
for(i=0;i<N;i++)
{
cout << x[i] << " ";
}
}
24.
(i) GetData();
Show data().
(ii) m and n
(iii) The base class is alpha and the derived class is gamma .
(iv) There is no private member functionn in the class gamma.
25.
(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.
26.
void countwords()
{
ifsream fin("PAPER.TXT",ios ::in);
char wd[80];
int count=0;
while(!fin.eof())
{
fin>>wd;
if(fin.eof())break;
count++;
}
fin.close();
count<<count;
}
27.
int countupcase()
{
ifstream fin("ARTICLE.TXT");
char ch;
int count = 0;
while(!fin.eof())
{
fin>>ch;
if(isupper(ch))
count++;
}
fin.close();
return count;
}
28.
#include<iostream.h>
#include<conio.h>
void main()
{
int a;
do
{
cout<<"Enter a";
cin>>a;
}
while((a<1)||(a<6));
for(int i=0;i<=a;i++)
{
for(int k=1;k<=(a-i);k++)
cout<<" "<<" ";
for(int j=1;j<=(2*i-1);j++)
cout<<j<<" "<<" ";
cout<<"\n";
}
getch();
}
29.
(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.
30.
#include
#include
void main()
{
int n, i;
clrscr();
cout<<"Enter the number to find the multiple";
cin>>n;
for(i=1;i<=10;i++)
cout< getch();
}
31.
( )
File.seekg(8,ios::beg);
32.
( )
2N input combinations can be there in the truth table of a logic system.
33.
( )
\(\overset { \_ \_ \_ \_ \_ \_ \_ \_ \_ \_ \_ \_ \_ \_ \_ \_ \_ \_ \_ \_ \_ }{ (A.\bar { B } +\bar { C } .\bar { D } ) } \) \(=\overset { \_ \_ \_ \_ \_ \_ \_ \_ \_ \quad \quad \_ \_ \_ \_ \_ \_ \_ \_ \_ \_ }{ (A.\bar { B } ).(\bar { C } +\bar { D } ) } \) [DeMorgan's law]
\(=(\bar { A } +\overset { \_ \_ \_ \_ }{ \bar { B } } ).(\overset { \_ \_ \_ }{ \bar { C } } +\overset { \_ \_ \_ \_ }{ \bar { D } } )\) [Demorgan's law]
\(=(\bar { A } +B).(C+D)\)
34.
( )
Using duality principle, changing (+) to(.) and vice-versa and by keeping the form of variables as such the dual of the expression is: \((\bar { X } +Y.Z).(\bar { X } +\bar { Y } .\bar { Z } )\)
35.
( )
| 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\)
36.
( )
| P | Q | R | F | Minterms |
| 0 | 0 | 0 | 1 | \(\bar { P } .\bar { Q } .\bar { R } \) |
| 0 | 0 | 1 | 0 | \(\bar { P } .\bar { Q } .R \) |
| 0 | 1 | 0 | 0 | \(\bar { P } .Q .\bar { R } \) |
| 0 | 1 | 1 | 1 | \(\bar { P } . Q .R \) |
| 1 | 0 | 0 | 0 | \(P .\bar { Q } .\bar { R } \) |
| 1 | 0 | 1 | 0 | \(P .\bar { Q } .R \) |
| 1 | 1 | 0 | 1 | \(P.Q .\bar { R } \) |
| 1 | 1 | 1 | 1 | P.Q.R |
SOP form of function F(P, Q, R) is: \(=\bar { P } .\bar { Q } .\bar { R } +\bar { P } .Q.R+P.Q.\bar { R } +P.Q.R\)
37.
( )
Trojan horse is a computer program, which carries out malicious operations without the user's knowledge. It is a piece of harmful code placed within a healthy program. While virus is a malicious program that damaged data and files and causes harm to computer system.
38.
( )
(i) HTTP HyperText Transfer Protocol.
(ii) VoIP Voice over Internet Protocol
39.
( )
(ii) Volp
40.
( )
(i) GPRS General Packet Radio Services
(ii) CDMA Code Division Multiple Access
(iv) GSM Global System for Mobile Communication
41.
( )
A modem is a data communication equipment that facilitates data communication through telephone lines. It is used to convert digital data into analog and vice-versa.
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.
( )
In a linear queue,if Rear is equal to maximum size then queue is full.
48.
( )
Circular queue will be full if ((front==Rear + 1) (Fornt == 0 && Rear ==N-1))
49.
( )
(i) 10
(ii) Front = 6
50.
( )
iostream.h ----> cin,cout
math.h -------> abs()
51.
( )
In switch -case statement, when a match is found, the statement sequence associated with that case is executed until a break statement or the end of switch statement is reached. So, if break statement is missing, then the statement sequence is executed until the end of the switch-case statement is reached.
52.
( )
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.
53.
( )
An object is areal world entity that consists of both data and function and this integrated unit
provides the necessary behaviour expected from the object.While a program module is a piece of code,which performs a particular function or set of functions.
54.
( )
Call 1,2 and 3 will invoke only function [I] because controls with match only function [I] at each
time.It is being called.And each time return value will ba an integer that can be assigned to a
higher data type easily.
55.
( )
No,it is not possible to declare two functions with same name and same argument but different
return type in C++,because the control will be confused at the time of calling which of these function will be executed first.
56.
( )
( x == y ) || ( ! ( z == y ) ) && ( z < x )
= (10 == 5) || (! (11 == 5) )&&( ( 11< 10)
= (10 == 5)||(1 && (11 < 10))
= (10 == 5)||(1 && 0)
= 0 || 0
= 0
57.
( )
There is no data type as long float in C++. The double data type denotes the same, thus the statement should be
double y;
58.
( )
i) 3 ii) 11
59.
(a) SELECT NAME FROM SPORTS WHERE GRADE ='C' OR GRADE1='C';
(b) SELECT COUNT (*) FROM SPORTS
WHERE (GAME1='CRICKET' AND GRADE='A') OR (GAME2='CRICKET'AND GRADE1='A');
(c) SELECT NAME FROM SPORTS WHERE GAME1=GAME2;
(d) SELECT GAME1, GAME2 FROM SPORTS WHERE NAME LIKE 'A%';
(e) ALTER TABLE SPORTS ADD(MARKS NUMBER(3));
(f) UPDATE SPORTS SET MARKS=200
WHERE GRADE ='A' OR GRADE='B' OR GRADE1='A' OR GRADE1='B';
(g) SELECT * FROM SPORTS ORDER BY NAME;
60.
(a) SELECT * FROM FAMILY WHERE Occupation='Sservice';
(b) SLECT Name FROM FAMILY WHERE FemaleMembers>3;
(c) SELECT Name, Income FROM FAMILY ORDER BY Income;
(d) SELECT N\ame, MaleMembers, Occupation FROM FAMILY WHERE Occupation='Business';
(e) SELECT COUNT(*) FROM FAMILY WHERE Income<10000;
(f) INSERT INTO FAMILY VALUES(9,'D'SOUZA',2,1,15000,'Service');
(g) The output is given after excluding the row given in part(f)
(i)
| MIN(DISTINCT Income) |
| 5000 |
(ii)
| MIN(FemaleMembers) |
| 6 |
(iii)
| SUM(I|ncome) |
| 31000 |
(iv)
| AVG(Income) |
| 17375 |
61.
(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 |
62.
(a) SELECT STRNAME FROM STREAM ORDER BY STRNAME;
(b) SELECT COUNT(*) FROM STUDENT WHERE POINTS>5;
(c) UPDATE STUDENT SET GRADE='A' WHERE POINTS>8;
(d) DELETE FROM STREAM WHERE STRCDE=6;
(e)
| SUM(POINTS) |
| 25 |
(f)
| STRCDE | MAX(POINTS) |
| 2 | 6 |
| 3 | 9 |
| 5 | 8 |
| 6 | 8 |
(g)
| AVG(AGE) |
| 14 |
(h)
| COUNT(STRNAME) |
| 3 |
63.
(a)SELECT CNAME,AREA FROM CUSTOMER
WHERE GENDER ='FEMALE';
(b) SELECT * FROM CUSTOMER ORDER BY SID, CNAME;
(c) SELECT AREA COUNT(*) FROM CUSTOMER GROUP BY AREA;
(d) SELECT CUSTOMER .CNAME, ONLINESHOP.SHOP
FROM CUSTOMER, ONLINESHOP WHERE CUSTOMER.SID=ONLINESHOP.SID;
(e)
| COUNT(*) | GENDER |
| 4 | FEMALE |
| 6 | MALE |
(f)
| COUNT(*) |
| 4 |
(g) No rows selected.
(h)
| DISTINCT AREA |
| NORTH |
| SOUTH |
| EAST |
| WEST |
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