CS201 Mid Term Past Paper all in one Mega file

 

CS201 Mid Term Past Paper all in one Mega file


Cs201 Solved Paper - Mis Term file #MCQ's & #Subjective - 2010

Question No.: 1      ( M a r k s: 1 )

Compiler is a  

       System software

       Application Software

       Driver        Editor

http://books.google.com.pk/books?id=AJt4O4AoCtgC&pg=PA1&lpg=PA1&dq=%22compiler+is+ a+system+software%22&source=bl&ots=iSKObzG2h5&sig=S_IlDilOXTgnIKvxdSOJN0lZZ8o&hl =en&sa=X&ei=dtB2UOqdFeWK4gSsrIDQCQ&ved=0CEoQ6AEwBw#v=onepage&q=%22compil er%20is%20a%20system%20software%22&f=false  

 

 Question No.: 2    ( M a r k s: 1 )

If Num is an integer variable then Num++ means,  

       Add 1 two times with Num  

       Add 1 with Num  

       Add 2 with Num  

       Subtract 2 from Num

 

 Question No.: 3    ( M a r k s: 1 )

For one byte there are _____ combinations of values that can be stored in computer.

       26  

       27  

       28 

       24

Each bit is capable of holding two possible values, the number of possible different combinations of values that can be stored in n bits is 2n. For example:

1 bit can hold 2 = 2^1 = 2 possible values (0 or 1) 2 bits can hold 2 × 2 = 2^2 = 4 possible values so 8 bits(one byte) = 2^8 = 256

 Question No.: 4      ( M a r k s: 1 )

In C/C++ language the header file which is used to perform useful task and manipulation of character data is           cplext.h         ctype.h pg 188         stdio.h          delay.h

 

 Question No.: 5      ( M a r k s: 1 ) 

 Default case in switch statement is,

Must         Optional         syntax error         Necessary

http://www.arduino.cc/en/Reference/SwitchCase

 

 Question No.: 6      ( M a r k s: 1 )   

When break statement is encountered in switch statement, it  

       Stops the entire program  

       Stops the execution of current statement

        Exits from switch statement         None of the given options

http://docs.oracle.com/javase/tutorial/java/nutsandbolts/switch.html

 

 Question No.: 7      ( M a r k s: 1 ) 

What will be the result of arithmetic expression 6+27/3*3?

       33  

       45  

       9 

       30

  

 Question No.: 8      ( M a r k s: 1 ) 

What is the correct syntax to declare an array of size 10 of int data type?         int [10] name ;          name[10] int ;          int name[10] ;  

       int name[] ; 

 

 Question No.: 9      ( M a r k s: 1 ) 

How many dimensions does n-dimensional array has?  

n           dimensions         2n dimensions  

       (n+1) dimensions  

       (n-1) dimensions (Array starts from 0th element)

 

 Question No.: 10      ( M a r k s: 1 )   

What will be the correct syntax to access the value of fourth element of an array using pointer ptr?         ptr[3]         (ptr+3)  

       *(ptr+3)  

       Both 1and 3

Question No.: 11      ( M a r k s: 1 )  

 Which of the following values C++ use to represent true and false?  

       1 and 0  

       1 and -1  

       11 and 00  

       Any numerical value

 

 Question No.: 12      ( M a r k s: 1 ) 

Declaring structures does not mean that memory is allocated.

       True        False http://www.exforsys.com/tutorials/c-plus-plus/c-structures.html

 Question No.: 13      ( M a r k s: 1 )  

 For which array, the size of the array should be one more than the number of elements in an array?

       Int         double         float   

       char Pg113

  

 Question No.: 14      ( M a r k s: 1 ) 

If a variable is passed by value to a function and the function makes some changes to that variable then it

       Does not affect the original variable pg 83

       affects the original variable         causes syntax error         None of the given options

 

 Question No.: 15      ( M a r k s: 1 )  

 In C/C++ the #include is called,

       Header file  

       Preprocessor Directive pg 269 

       Statement  

       Function

  

 Question No.: 16      ( M a r k s: 1 )  

Loops are ------------------------ Structure.

       Decision  

       Repetition pg 560 

       Sequential  

       Hierarchical

Question No.: 17      ( M a r k s: 2 )

Which variable will be used in inner code block if we have the same names of variable at outer code block and inner code block?

Pg No 91

 

 Question No.: 18      ( M a r k s: 2 ) 

 Which variable will be used in inner code block  pointer.

Pg No 90

  

 Question No.: 19      ( M a r k s: 2 )

Which standard library is included when your program reads from, or writes to, files? Pg No 199

 

 Question No.: 20      ( M a r k s: 3 )

Perform left shift operation on a binary number 0101 and write the result in binary and decimal.  Pg No 252

           

 Question No.: 21      ( M a r k s: 3 )

What is difference between variable and pointer?

 

Variables Pg No 16

 

Pointers: Pg No 143

 

 Question No.: 22      ( M a r k s: 5 )

 Write a C/C++ program which defines an array of 10 elements.

This program should ask a number from the user and search this number in the array if

the number exists in the array, it should display the location of the number otherwise display the message The number is not in the given array. 

  

 Question No.: 23      ( M a r k s: 5 )

Write a C/C++ program which defines an array of 15 elements and fill the array with string "12players2teams".This program should display that how many digits and alphabets the string "12players2teams" contains using Character handling functions. 

Cs201 Solved Paper - Mis Term file #MCQ's & #Subjective -2011

Question No: 1      ( M a r k s: 1 )  

In C/C++ the string constant is enclosed

In curly braces

In small braces

In single quotes ► In double quotes

http://www.lugaru.com/man/String.Constants.html

  

                   Question No.: 2    ( M a r k s: 1 )                          

For one byte there are _____ combinations of values that can be stored in computer.

       26  

       27  

       28 

       24

Each bit is capable of holding two possible values, the number of possible different combinations of values that can be stored in n bits is 2n. For example: 1 bit can hold 2 = 2^1 = 2 possible values (0 or 1) .2 bits can hold 2 × 2 = 2^2 = 4 possible values so 8 bits(one byte) = 2^8

= 256

Question No: 3      ( M a r k s: 1 )  

Switch statement deals with,

► Integer data only

float data only

character data only

► Integer and character data

http://docs.oracle.com/javase/tutorial/java/nutsandbolts/switch.html

  

Question No: 4      ( M a r k s: 1 )  

A record is a group of related _____________.

Files

Bytes

► Fields

-> DATA

 

 http://wps.prenhall.com/esm_deitel_javahtp_6/25/6592/1687696.cw/content/index.html Ref 2: 

http://books.google.com.pk/books?id=fCKOomc6NiYC&pg=PT721&lpg=PT721&dq=%22A+reco rd+is+a+group+of+related++%22&source=bl&ots=gV8WAZayiV&sig=QJafvBmGwVjyAoIWs2M v60cHogY&hl=en&sa=X&ei=vap5UPLNEcSF4ASaiYDQAg&ved=0CC8Q6AEwAw

Question No: 5      ( M a r k s: 1 )  

C++ views each file as a sequential stream of _______________.

Bytes

Bits

0’s or 1’s

Words

 

http://books.google.com.pk/books?id=TN9wQjjDwp0C&pg=PA582&lpg=PA582&dq=C%2B%2B

+views+each+file+as+a+sequential+stream+of&source=bl&ots=kD6-

M5Y9Ur&sig=XYHg_wet5FD6RnnuySh_q5e49JE&hl=en&sa=X&ei=H6h5UKiuNsmk4gSbkoGo

Ag&ved=0CC0Q6AEwAA#v=onepage&q=C%2B%2B%20views%20each%20file%20as%20a% 20sequential%20stream%20of&f=false

 

Question No: 6      ( M a r k s: 1 )  

To access the element of two dimensional array we use,

Single referencing

Single dereferencing

Double dereferencing

► Double referencing  Pg175

  

Question No: 7      ( M a r k s: 1 )  

If it is required to copy an array to another array then,

► Both arrays must be of the same size and data type Pg 105

Both arrays may be of different size

Both arrays may be of different data type

Both arrays may be of different size and type

 

Question No: 8      ( M a r k s: 1 )  

The precedence of * is higher than dot operator 

► False

                ► False 

http://docs.realsoftware.com/index.php/Operator_Precedence

Question No: 9      ( M a r k s: 1 )  

Pointers works by pointing to a data type, which can be of the form,

Integer only

double only

character only

► All of the given options Pg 144

Question No: 10      ( M a r k s: 1 )  

Which of the following data type(s) can operate on modulus operator ‘%’?

float, int

float, double

► int Pg 22

char

  

Question No: 11      ( M a r k s: 1 )  

What will be the output of following code? int x = 10 ;

cout << “x =” << x ;

10

“x=10”

► x=10

10=x

 

Question No: 12      ( M a r k s: 1 )  

Which looping process checks the test condition at the end of the loop?

for

while

► do while

no looping process checks the test condition at the end

http://publib.boulder.ibm.com/infocenter/dmndhelp/v6rxmx/index.jsp?topic=/com.ibm.btools.help .modeler.collab.publish.doc/doc/concepts/modelelements/loop.html

 

Question No: 13      ( M a r k s: 1 )  

What will be the correct syntax of the following statement? ptr is a constant pointer to integer.

const int *ptr ;

const *int ptr ;

int const *ptr ;

► int *const ptr ; Pg 154

  

Question No: 14      ( M a r k s: 1 )  

A function must always return value.

True

             ► False

http://publib.boulder.ibm.com/infocenter/comphelp/v8v101/index.jsp?topic=%2Fcom.ibm.xlcpp8 a.doc%2Flanguage%2Fref%2Fcplr240.htm

  

 

Question No: 15      ( M a r k s: 1 )  

C is a/an ______ language

low level

object based

object oriented

► function oriented pg 82

  

Question No: 16      ( M a r k s: 1 )  

Assignment operator is used for ___________.

calculation

reading

► assigning value to variables Pg 17 None of the given options.

 

Question No: 17      ( M a r k s: 2 )

What is the difference between switch statement and if statement.

 

1.if statement is used when we have to check two conditions while switch is a multi conditional control statement.

2. SWITCH statement can be executed with all cases if the “break” statement is not used whereas IF statement has to be true to be executed further. 

 

Question No: 18      ( M a r k s: 2 )

What is wrong with following code and also give the reason of error? int x , y ; int *ptr1 = &x ; int *ptr2 =&y ; ptr1+ptr2 ; Answer:

We need one more variable in which we put sum of ptr1 and ptr2 like

Int z; z=ptr1+ptr2;


Question No: 19      ( M a r k s: 2 )

Which bit of the number is used as a sign bit?

The most significant bit of the number is used as a sign bit (to denote the sign of the number). (Answer provided by Ferhat Qudsia)

 

 

Question No: 20      ( M a r k s: 3 )

What is the difference between tellg() and tellp() functions? Pg No.215

 

Question No: 21      ( M a r k s: 3 )

What is difference between variable and pointer?

 Variables Pg No 16

Pointers: Pg No 143

 

Question No: 22      ( M a r k s: 5 )

What happened when we try to copy the array ‘arr1’ into the array ‘arr2’ in the following code segment, justify your answer?

main()

{

int arr1[3]={2,3,5};

int arr2[3];

arr2=arr1;

}

We can not copy array directly in this way (arr2=arr1;)  Each member of arr1 to be copied by each member of arr2.

We can use for loop to copy array 1 to array2


 

           

Question No: 23      ( M a r k s: 5 )

Differentiate between random access and sequential access file?

 

Random access file:

Random access files are not in sequence mean its not necessary put that’s thing first that written first we put any thing from file any where.So tellg() and tellp() are the two very useful functions while reading from or writing into the files at some certain position.

Sequential access file:

Sequential access files are simple character files. while working with the sequential access files we write in a sequence not in a random manner


 

Cs201 Solved Paper - Mis Term file #MCQ's & #Subjective - 2013

Question No: 1      ( M a r k s: 1 ) 

Compiler is a  

 

                  System software                                                                      

Application Software 

Driver 

Editor 

 

http://books.google.com.pk/books?id=AJt4O4AoCtgC&pg=PA1&lpg=PA1&dq=%22compiler+is+ a+system+software%22&source=bl&ots=iSKObzG2h5&sig=S_IlDilOXTgnIKvxdSOJN0lZZ8o&hl =en&sa=X&ei=dtB2UOqdFeWK4gSsrIDQCQ&ved=0CEoQ6AEwBw#v=onepage&q=%22compil er%20is%20a%20system%20software%22&f=false  

 

Question No: 2      ( M a r k s: 1 ) 

When the logical operator AND (&&) combine two expressions exp1 and exp2 then the result will be true only, 

► When both exp1 and exp2 are true Pg 246

When both exp1 and exp2 are false

When exp1 is true and exp2 is false

When exp1 is false and exp2 is true 

 

Question No: 3      ( M a r k s: 1 ) http://vuzs.nt

 Which of the following function(s) is/are included in ctype.h header file?

► isdigit(int c)

isxdigit(int c )

tolower(int c)

► All of the above  Pg 188

 

Question No: 4      ( M a r k s: 1 ) 

 To access the data members of structure _______ is used.

► dot operator (.) pg 231

* operator

 operator None of given.

 

Question No: 5      ( M a r k s: 1 ) 

The address operator (&) can be used with,

Statement

Expression

► Variable Pg 149

            Constant

Question No: 6      ( M a r k s: 1 ) 

Both compiler and interpreter are used to translate program into machine language code.

► True False

http://readanddigest.com/what-are-the-differences-between-compiler-and-interpreter/

 

 

Question No: 7      ( M a r k s: 1 ) 

Missing semicolon ‘;’ at the end of C++ statement is

Logical error

Syntax error Pg 16

Runtime error

None of the given options

 

Question No: 8      ( M a r k s: 1 ) 

 Switch statement is an alternative of _________ statement ► multiple if

continue

break

goto

 

http://books.google.com.pk/books?id=bjE5EHw35DkC&pg=PA239&lpg=PA239&dq=%22mutiple +if+statement+is+alnternative+of+Switch+statement+%22&source=bl&ots=0AjPQu6EZa&sig=X

1QMvHuYa5Abfze3M43tSVUEbRc&hl=en&sa=X&ei=2_Z6UImFHofd4QTBz4HABw&ved=0CC4 Q6AEwAA#v=onepage&q=%22mutiple%20if%20statement%20is%20alnternative%20of%20Swi tch%20statement%20%22&f=false

 

 

Question No: 9      ( M a r k s: 1 )  

Array is passed by value to a function by default.

True

► False Pg 266

  

Question No: 10      ( M a r k s: 1 )  

Which of the following is the correct function call having array named student of 10 elements as a parameter. ► addRecord(student[]) ;

addRecord(student) ;

► addRecord(student[10]) ;

addRecord(*student) ;

 

Question No: 11      ( M a r k s: 1 )  

What will be the result of expression x%= 2, if x = 7?

                ► x = 1

x = 3

x = 7

x = 2

 

Question No: 12      ( M a r k s: 1 )  

 What will be the output of following code segment? 


 main(){ int x = 5 ;

                { int x = 4 ;

                cout <x

                }

                cout <x

                  }  

► 5, 5

► 4, 4

► 4, 5

5, 4

 

Question No: 13      ( M a r k s: 1 )   

Which of the following operator is used to access the value of variable pointed to by a pointer?  * operator

-> operator

&& operator

& operator

 

Question No: 14      ( M a r k s: 1 )  

The object _______________may be used both for file input and file output

► fstream, Pg 199

ifstream,

ofstream,

none of the given options.

 

Question No: 15      ( M a r k s: 1 )   What's wrong with this for loop?

for (int k = 2, k <=12, k++)

the increment should always be ++k

the variable must always be the letter i when using a for loop

there should be a semicolon at the end of the statement

the commas should be semicolons

 

Question No: 16      ( M a r k s: 1 )  

                Let suppose 

Union intorDouble{ 

Int ival; 

Double charvar; 

};  

main(){ 

intorDouble  VAZ; 

 

int size ; 

size = sizeof(VAZ); 

What will be the value of variable "size", if int occupies 4 bytes and double occupies 8 bytes?

2

4

8

12

 

Question No: 17      ( M a r k s: 2 ) 

How a program can use a function?  

 The calling program just needs to write the function name and provide its arguments (without data types). It is important to note that while calling a function, we don’t write the return value data type or the data  types of arguments. 

 

Question No: 18      ( M a r k s: 2 ) 

Which function is used to read/write more than a single character or single line while handling files?

We use the getline function to read more than single charcter 206

 

Question No: 19      ( M a r k s: 2 ) 

Suppose the pointer yptr is pointing to the first element of the array y and the size of array is 10. Can we increment the yptr up to 12 times? And what will happen?

 

Question No: 20      ( M a r k s: 3 ) 

(i)         An array day is declared as: int day[] = {1, 2, 3, 4, 5, 6, 7}; How many elements does array 'day' has?

(ii)        If the declaration is changed as: int day[7] = {1, 2, 3, 4, 5, 6, 7}; How many elements does array 'day' has?

In both the case array day has the 7 elements.  

 

Question No: 21      ( M a r k s: 3 ) 

What is the difference between tellg() and tellp() functions? Pg No.215

 

Question No: 22      ( M a r k s: 5 ) 

Write code which read a string not greater than 20 characters from keyboard stored it in an array Name and display it on the screen.

 

Question No: 23      ( M a r k s: 5 ) 

 

Write a C/C++ program which defines an array of 15 elements. This program changes all uppercase letters of an array into lowercase letters and all lowercase letters to uppercase using Character handling functions.

 

Cs201 Solved Paper - Mis Term file #MCQ's & #Subjective - 2012

Question No: 1      ( M a r k s: 1 )  

C language is developed by

Bill Gates

Robert Lafore

► Dennis Ritchie Pg 12

Deitel & Deitel

 

Question No: 2      ( M a r k s: 1 )  

Which of the following choice is not an example of an int datatype?

0

-32

65531

-4.0

 

Question No: 3      ( M a r k s: 1 )  

In flow chart, the symbol used for decision making is,

Rectangle

Circle

Arrow

Diamond Pg 51

 

Question No: 4      ( M a r k s: 1 )  

Switch statement deals with,

Integer data only

float data only

character data only

► Integer and character data

http://docs.oracle.com/javase/tutorial/java/nutsandbolts/switch.html

 

Question No: 5      ( M a r k s: 1 )  

        Default case in switch statement is,
        Must
        ► Optional

syntax error Necessary

http://www.arduino.cc/en/Reference/SwitchCase

 

 

Question No: 6      ( M a r k s: 1 )  

*doc is _____________ by type.

► Sequential File

Random Access File

Data File

Record File

 

Question No: 7      ( M a r k s: 1 )  

Member function tellg() returns the current location of the _____________ pointer.

tellptr()

write()

seekg()

► get()

 

http://enggedu.com/tamilnadu/university_questions/question_answer/be_nd_2007/3rd_sem/cse/ cs1204/part_b/13_a_1.html

 

Question No: 8      ( M a r k s: 1 )  

Dealing with structures and functions passing by reference is the most economical method

► True False http://mathbits.com/MathBits/CompSci/Structures/Functions.htm

Question No: 9      ( M a r k s: 1 )  

In C/C++ all character strings are terminated with,

Null character

String

► Zero Pg 166

Full stop

 

Question No: 10      ( M a r k s: 1 )  

                  Word processor is                      

Operating system

► Application software

Device driver

Utility software

http://books.google.com.pk/books?id=R5w4cJYJl5cC&pg=PA220&lpg=PA220&dq=%22Word+p rocessor++is+an+application+software%22&source=bl&ots=YD0gggdOOr&sig=k5aI9mm88OJY

LVg_8Zf7zIvsOeI&hl=en&sa=X&ei=MSN4ULreEKbd4QSn-

4HYCg&ved=0CBsQ6AEwAA#v=onepage&q=%22Word%20processor%20%20is%20an%20ap plication%20software%22&f=false

 

Question No: 11      ( M a r k s: 1 )  

Which of the following can not be a variable name?

area

_area

► 10area

area2

 

Question No: 12      ( M a r k s: 1 )  

Which looping process is best, when the number of iterations is known?

► for

while

do-while

all looping processes require that the iterations be known

 

http://en.wikipedia.org/wiki/For_loop

 

Question No: 13      ( M a r k s: 1 )  

By default an array of characters is passed by value to a function.

True ► False http://books.google.com.pk/books?id=bdzzlLOJb1YC&pg=PA76&lpg=PA76&dq=in+c%2B%2B+ By+default+an+array+of+characters+is+passed+by&source=bl&ots=2AEoxqdTGk&sig=wGmO

OHtJ8FvfUAaMjyC5MG94SfM&hl=en&sa=X&ei=LFCBUI3_IaHl4QSq94HgBQ&ved=0CCwQ6A EwAA#v=onepage&q=in%20c%2B%2B%20By%20default%20an%20array%20of%20character s%20is%20passed%20by&f=false

 

Question No: 14      ( M a r k s: 1 )  

Which of the following operator is used to access the address of a variable?

► * operator

-> operator

&& operator

► & operator Pg 480

 

Question No: 15      ( M a r k s: 1 )  

The name of an array represents address of first location of array element.

► True Pg 120

False

 

Question No: 16      ( M a r k s: 1 )  

Let suppose

Union intorDouble{

 

Int ival;

Double charvar;

};

main(){ intorDouble  VAZ; int size ;

size = sizeof(VAZ);

}

What will be the value of variable "size", if int occupies 4 bytes and double occupies 8 bytes?

2

4

8

12

 

Question No: 17      ( M a r k s: 2 )

What is the difference between for loop and while loop?

 

When number of iterations known we use for loop otherwise we will use while loop 

 

Question No: 18      ( M a r k s: 2 )

Consider the structure

struct Customer

{

int custnum; int salary;

float commission;

};

A programmer wants to assign 2000 for the structure member salary in the above example of structure Customer with structure variable cust1 What line of code should he write.

 

Question No: 19      ( M a r k s: 2 )

When a pointer is incremented then how many bytes will it move to change its address? If an integer occupies four bytes in the memory, then the yptr++; will increment its value by four.

when we increment the yptr, it points to the next integer in the memory

 

Question No: 20      ( M a r k s: 3 )

If there are 2n elements in an array then what would be the number of iterations required to search a number using binary search and linear search?

 

If an array has elements 2n, then the maximum number of iterations required by binary search will be n.

 

 

Question No: 21      ( M a r k s: 3 )

Perform left shift operation on a binary number 0101 and write the result in binary and decimal.

 

Question No: 22      ( M a r k s: 5 )

What will be the output of following code segment? void func(int [], int);

main(){

int arr[5] = {2, 3, 5, 6, 7} ; func(arr, 5) ; for (int i = 0; i<5; i++)

cout << arr[i]  << “ ”;

}

void func(int a[], int size){ for (int i = 0; i<size; i++) a[i] = 2*a[i];

}

Question No: 23      ( M a r k s: 5 )

What is random access file and how data can be read and write into random access file?

 



Cs201 Solved Paper - Mis Term file #MCQ's & #Subjective - 2009

Question No: 1      ( M a r k s: 1 )

In C/C++ the #include is called,

►Header file

Preprocessor Directive pg 269

►Statement

►Function

 

 Question No: 2      ( M a r k s: 1 )

To access the element of two dimensional array we use,

►Single referencing

►Single dereferencing

Double dereferencing Pg175

►Double referencing

 

 Question No: 3      ( M a r k s: 1 )

Data Size of the file is always___________ the actual size of the file.

►Greater than

►Equal to

►Less than or equal to

 

►None of the above Pg 216

Similarly in case of files, the space occupied by a file (file size) can be more than the actual data length of the file itself.

 

 Question No: 4      ( M a r k s: 1 )

When an identifier is declared with keyword const then, ►Its value can be changed during execution.

►Its value can not be changed Pg110

►Its value can be changed with arithmetic operator

►Its value can be overwritten

 

 Question No: 5      ( M a r k s: 1 )

In C/C++ if we define an array of size eight (8) i.e. int Arr [8]; then the last element of this array will be stored at,

►Arr[0] ►Arr[8]

Arr[7]

►Arr[-1]

 

 Question No: 6      ( M a r k s: 1 )

If it is required to copy an array to another array then,

Both arrays must be of the same size and data type Pg 105

►Both arrays may be of different size

►Both arrays may be of different data type

►Both arrays may be of different size and type

 

 Question No: 7      ( M a r k s: 1 )

In C/C++ all character strings are terminated with,

Null character Pg 166

► String

► Zero  

► Full stop

 

 Question No: 8      ( M a r k s: 1 ) Let suppose

struct intorDoubl

e { int ival; Double charvar;

};

 

main(){ intorDouble VAZ;

int size ; size =

sizeof(VAZ);

}

What will be the value of variable size, if int occupies 4 bytes and double occupies 8 bytes?

► 2 ► 4

► 8

► 12

 

 Question No: 9      ( M a r k s: 1 )

When a pointer is incremented, it actually jumps the number of memoryaddresses According to data type Pg 160

►1 byte exactly

►1 bit exactly

►A pointer variable can not be incremented

 

 Question No: 10      ( M a r k s: 1 )

Do-while loop executes at least, 

►Zero Time

One Time

►Two Times ►N Times

http://books.google.com.pk/books?id=xnEYsMiYgiMC&pg=PA521&lpg=PA521&dq=%22Dowhile+loop+executes+at+least+One+Time%22&source=bl&ots=hovQ0faYdl&sig=_z9IXC5Zmxt

5JsWJS6aVgrd9YKg&hl=en&sa=X&ei=Yw98UNCOEoiD4gS734HoCg&ved=0CCAQ6AEwAQ#v

=onepage&q=%22Dowhile%20loop%20executes%20at%20least%20One%20Time%22&f=false

 

 Question No: 11      ( M a r k s: 1 ) += , *= , /= , etc are called,

►Assignment operators

►Logical operator

Compound assignment operator Pg 63

►Unary operator

 

 

 Question No: 12      ( M a r k s: 1 )

Computer can understand only machine language code.

True Pg 12

►False

 

Which of the following is the correct syntax to print multiple values or variables in a single command using cout?

►cout <

►cout <

►cout <

►cout <

 Question No: 14      ( M a r k s: 1 )

The compilers and interpreters also belong to the System Software category.

True Pg 11

►False

                  Question No: 15      ( M a r k s: 1 )                                          

Editors are used to compile the code.

►True

False 

 

Compilers are used for compilation of source codes, However Editors are used to write the source codes.

 

Question No: 16      ( M a r k s: 1 )

The variables having a name, type and size are just like empty boxes.

True

►False

 

Question No: 17      ( M a r k s: 1 )  What will be the result of the statement rand ( ) % 50

 

When 50 divides any number, the remainder will always be less than 50.  

Question No: 18      ( M a r k s: 1 ) What is the ASCII code of null character The ASCII code of null character 00.

 

Ref” http://www.theasciicode.com.ar/ascii-control-characters/null-character-ascii-code-0.html

 

Question No: 19      ( M a r k s: 2 ) What is a truth Table?

           

A truth table is a mathematical table used in logicspecifically in connection with Boolean algebra, Boolean functions, and propositional—to compute the functional values of

logical expressions on each of their functional arguments, that is, on each combination of values taken by their logical variables .In particular, truth tables can be used to tell whether a propositional expression is true for all legitimate input values, that is, logically valid.

 

 

 Question No: 20      ( M a r k s: 3 )

How learning to design programs is like play soccer?

 

Learning to design programs is like learning to play soccer. A player must learn to trap a ball, to dribble with a ball, to pass, and to shoot a ball. Once the player knows those basic skills, the next goals are to learn to play a position, to play certain strategies, to choose among feasible strategies, and, on occasion, to create variations of a strategy because none fits. 

 

Question No: 21      ( M a r k s: 5 )

What is the purpose of the default statement

 

The default statement is optional. If there is no case which matches the value of the switch statement, then the statements of default are executed. 

 

Question No: 22      ( M a r k s: 10 )

Write a program which contains a user defined f takes 3 integer arguments hours,  minutes and seconds and returns the number of seconds.

 

ConvertInSeconds that

Input variables hours , minutes and seconds in main program and call the fun ConvertInSecondsand display the number of seconds returned by function.

Hint:

1 hour =60 minutes

            1 minute =60 seconds 

Cs201 Solved Paper - Mis Term file #MCQ's & #Subjective - 2012

more papers adding soon...


Post a Comment

Previous Post Next Post