CS201-MidTerm-By Rana Abubakar Khan

Download as pdf or txt
Download as pdf or txt
You are on page 1of 17

Rana Abubakar Khan

If you want to learn computer programming then contact with me

[email protected]

JOIN FB GROUP FOR VU HELP


www.facebook.com/groups/vu1234/
CS201 MIDTERM PAPER SHARED BY STUDENT

REPLY BY BY_RANA_ABUBAKAR_KHAN ON JUNE 23, 2018 AT 9:44PM

CS201 Mid term paper 23 June 2018 2:30 PM By Kashaf Mushtaq

Today's Paper was sooooo easy.

MCQs were very easy also subjective was just like chewing bubble.

MCQs were 18

3 Marks Q = 2

5 Marks Q = 3

1
Q.1 Write the code of the following arrays; Marks(3)

1. float array length 8

2. float array length 8 to pointer

Q.2 Find the error in the following. Marks(3)

int number;

if(number/2==0)

cout"The number is even:";

else()

cout"The number is odd:";

getch();

2
}

Q.3 Write a program in C++ to calculate the Average Price of the book. Marks(5)

calculations given the. Inputs ly kr display krwana tha.

Q.4 Give the output of the following

int It=1 nt=o s;

int number=8;

if(nt<number/2)

coutIt"\t";

s=nt+It

3
nt=It

s=It

Q.5 Write a code to find the product.

product= number *2^5

input ly kr output show krwani the.

CS201 MIDTERM PAPER SHARED BY STUDENT

REPLY BY BY_RANA_ABUBAKAR_KHAN ON JUNE 23, 2018 AT 10:19PM

current papr cs201 file 1 23 june spring 2018

Today cs201 paper

1.General syntax of switch statement

2. Applications softwares with examples

4
3. Output of program having arrays

4. To write a program arrays of 10 elements. Sorting. Find minimum and maximum numbr

For mcqs just study past papers and read handouts once

CS201 MIDTERM PAPER SHARED BY STUDENT

REPLY BY BY_RANA_ABUBAKAR_KHAN ON DECEMBER 9, 2017 AT 12:50PM

Today cs201 paper.z

How many dimensions in n dimension array.

Loop is also called..reptative...Structure

access array in random which approach is best

=< ,<= ,>= are called ..relational... operators

#include is called.. preprocessor directive..

Not example of int data ..-4.0..

All element of data must be of .... same type..

Analysis is the .. first..step

Array are ..call by reference...

Move to next iteration of loop .. continue statement...is used

A hierchy of classes which are used to deal with console and disk file.. iOS..

.. functions..are good for code reusability.

Bitwise and work same like.. logical.. and but on bits

SUBJECTIVE.

5
Write 2d array with five rows and six column and also write pointer to above array.?

Why we comment liberally in programs does they affect on performance...?

A do while loop executive ho many times at least and a while loop?

Then 2 program likhi thy inline output likhi thy ak array main say tha aur doses open file...

CS201 MIDTERM PAPER SHARED BY STUDENT

CS201 9/12/2017 _ 2:30PM PAPER

cs201 aj 2:30 ka mera paper

MCQS mostly moaz ki file sy thy

r long q

main(){

int x = 10

const int *ptr = &x ;

*ptr = 5 ;

dosra Q aesy tha

Write down the output of the code given below :

6
Hint:

Size of char is 1 byte

Size of int is 2 byte

Size of float is 4 byte

#include <iostream.h>

union mytypes_t {

char c;

int i;

float f;

} mytypes;

int main(){

mytypes.c = 'H';

mytypes.i = 15;

cout sizeof(mytypes)endl;

mytypes.i = 15;

mytypes.c = 'H';

cout sizeof(mytypes)endl;

system("PAUSE");

return 0;

r baqi yad nahi

7
CS201 MIDTERM PAPER SHARED BY STUDENT

REPLY BY BY_RANA_ABUBAKAR_KHAN ON DECEMBER 10, 2017 AT 9:51PM

cs201 mera ajka paper MCQS 90% Moaz ki file sy thy

short Q: Write down the output of the code given below :

Hint:

Size of char is 1 byte

Size of int is 2 byte

Size of float is 4 byte

#include <iostream.h>

union mytypes_t {

char c;

int i;

float f;

} mytypes;

int main(){

mytypes.c = 'H';

mytypes.i = 15;

cout sizeof(mytypes)endl;

mytypes.i = 15;

mytypes.c = 'H';

cout sizeof(mytypes)endl;

8
system("PAUSE");

return 0;

r 1 or Q: JO 3 marks ka tha wo ye

Identify the errors in the following code segment and give the reason of errors.

main(){

int x = 10

const int *ptr = &x ;

*ptr = 5 ;

baqi 1 programme likhta tha convert weight wala sai sy baqi yad na

CS201 MIDTERM PAPER SHARED BY STUDENT

ON JUNE 3, 2017 AT 6:21PM

***CS201***

Aik program likhen jismai aik item ka 15% tax display krwana hai. Program mai pehle user sy input lyn phr uska
15% tax display krwana hai

***CS201***

Aik program bnayen jismai user sy input lyn radius ki or switch statement sy 2 case likhen

1. Enter A or a to find area of circle.

2. Enter C or c to find Circumference of circle

Formula given thy ....

****CS201****

9
Aik 2D array bnayen jismai 4 rows hn or 2 cols or phr usko display krwayen(mene rand() use kia) phr usmai 1st
row ky elements display krwayen msln agr aik array hai

23 43. 5. 84.

54. 42. 1. 75

To display ho

23 43 5 84

CS201 MIDTERM PAPER SHARED BY STUDENT

ON JUNE 3, 2017 AT 7:06PM

By amna mughal

todat my cs201 paper

mcqs mostly from moaaz collection (18 marks)

do while loop pe program likhna tha(5 marks)

& | operators ke bre me likhna tha(3 marks)

program me highlight lines ko explain krna tha (5 marks)

aik or program e likhna tha wo yad ni( 5marks)

program ka out put btana tha(3 marks)

CS201 MIDTERM PAPER SHARED BY STUDENT

ON JUNE 4, 2017 AT 11:48AM

5 marks

Write a program using switch statement that should prompt the user to enter radius of circle.

10
After getting input from user, it should display the following menu to user.

1. Press ‘A’ or ‘a’ to calculate area


2. Press ‘C’ or ‘c’ to calculate circumference

When user enters correct choice then corresponding task should be executed.

If user presses key other than above option then message “Option is not available” should be
displayed on output screen.

Formula for:

Area of Circle: 3.14 × radius × radius


Circumference of Circle: 2 × 3.14 × radiu

CS201 MIDTERM PAPER SHARED BY STUDENT

ON JUNE 4, 2017 AT 11:50AM

Another Paper:

Q1: int*myarray[]={"amir"} how many memory bytes??

Q2: write the functionality of :


a- int*constIntptr=&x;
b- constint *intptr=&x;

Q3:name any three system software and explain how system software controls hardware.?

Q4- What is call by reference & call by value?

Q5- Write a structure program with members base,hypotenuse,and perpendicular?

11
CS201 MIDTERM PAPER SHARED BY STUDENT

REPLY BY MARRI ON JUNE 11, 2017 AT 3:07PM

Asalamualikum guys my CS201 paper:

subjective paper:

Q19: marks 3

int num[3][2]={12,51,34,54,14,55};

for(int j =0; j<3; j++)

cout(*(*num+j)+1)endl;

Q20: marks 3

a=3;

b=a++;

12
cout"a="a;

cout"b="b;

Q21: marks 5

write a code to read a string not greater than 20 character from keyboard, store it in on array and display it on
screen.

Q22: marks 5

calculate the area of circle. you have to declare two variables for this, one is area and other is radius. take the
value of radius from user.

hint: Area of circle= 3.14 *radius * radius

Q23: marks 5

write a program that prompts the user to enter a string & reverse the string using pointer & display the string in
reverse order on the output screen. program must include the complete line include spaces.

best of luck guys.....

13
CS201 MIDTERM PAPER SHARED BY STUDENT

REPLY BY ALI ALI ON JUNE 11, 2017 AT 6:00PM

ASSLAM O ALIKUM

mcqz mostly from past paper.

1. float array[8] declare krni the and then pointer pas krna tha.

2. utilty software kounsy hoty hn example.

3. net salary caluculate krni the c++ program likh kr dailywages= 1000 aur no of days

khud write krny thy salary= dailywages*no of days.

4.string declare krni the "this is my country"

5. ak program. m, n values batani the after execution of program.

THANKS

14
CS201 MIDTERM PAPER SHARED BY STUDENT

CS201 MID TURM EXAM 17 DEC 2016 BY ABDUL SHAKOOR

Subjective:

Q-Write down the general syntax of switch statement.

Q-Write a code segment that displays the diagonal element of a matrix of NxN.

where N can be any number and represents demention of matrix

Q-Mention any two affects in a programme who can occur as a result of an overflow condition.

CS201 MIDTERM PAPER SHARED BY STUDENT

18 DECEMBER 2016 TIME 2:30 OBJECTIVE PAPER

1. You can use a ____GOTO_____ statement to transfer control elsewhere out of the nested structure.

2 Overflow condition occurs when we try to assign a value to a variable which is __________.
3. Reusing the __________ in program helps to save the memory.
4 When an array is passed to a function, by default it will be passed by_____________.
5. There are mainly -------------------- types of software.
6. In 2D array, the technique used to access the array elements is called ___________.

7. Characters are represented inside the computers in terms of code number which is called ________ encoding
scheme.

8. __________ is used to check for the end of file when a file is being read.

15
9. When the logical operator AND (&&) combines two expressions exp1 and exp2 then the result will be true only
____________

10. The left-shift operator can be used to pck two character values into a ____________ integer variable.

.......................................................................
Subjective question

What will be the output of the given progrm code ?

#include

main()
{

int num[3][2] = {12, 51, 34, 54, 14, 55};

for(int j=0; j<3; j++) cout*(*(num + j) + 1)/p>

CS201 MIDTERM PAPER SHARED BY STUDENT

19 DECEMBER 2016 MTH 301

objective

1. Which of the following has the general equation of the form , where a,b,c,d are real numbers.

2. Limit of a constant function is . . . . . . . . . . .

3. The function is continuous in the region --------- and discontinuous elsewhere.

4. Every differentiable function is always . . . . . . . . . . . .

5. The vector is . . . . . . . . . . . . to both .

6. Gradient of a scalar function always results in a . . . . . . . . . . . function.

7. is called . . . . . . . . . . . . . . . . . of equation of a plane.

8. If has a relative extremum at a point and both the first partial derivatives of exist at this point, then . . . . . . . . . . . .

16
9. If has a relative extremum at a point and both the first partial derivatives of exist at this point, then

10. Double integral of a function represents . . . . . . . . . of the region between the surface defined by the function
and the plane which contains its domain.

11. The parabola will open upwards if . . . . . . . . .

17

You might also like