Latest Activity In Study Groups

Join Your Study Groups

VU Past Papers, MCQs and More

We non-commercial site working hard since 2009 to facilitate learning Read More. We can't keep up without your support. Donate.

CS201 - Introduction to Programming Quiz No. 02 Solution and Discussion Fall 2013 Open Date:Monday, December 02, 2013 Close Date:Tuesday, December 03, 2013.

Quiz No. 2 Dated: Nov 22, 13

Dear Student,

Quiz No. 2 of CS201 will be started from Monday, December 02, 2013 and ends atTuesday, December 03, 2013.  
Quiz No. 1 will cover 7-12 lectures.  There will be 10 questions in the quiz.  

Views: 3216

Replies to This Discussion

Answers

Q 1 Ans: ctype.h

Q2: Ans subscript

Q3: Ans the first row become the first column and the second row become the second column

Q4: Ans 1

Q5: Ans const int *ptr

Q6: Ans memory address

Q7: Ans end

Q8: ans design phase

Q9: Ans byte

Q10: Ans Char

Question # 4 of 10 ( Start time: 09:50:51 AM ) Total Marks: 1 
The ASCHI code of null character is___________ 
Select correct option: 
000 
010 
111 
110

Question # 5 of 10 ( Start time: 09:51:39 AM ) Total Marks: 1 
What will be the output of the following while loop? int counter = 0 ; while(counter < 15) cout counter “ ”; counter++; 
Select correct option: 
1 2 3 4 
1 2 3 4 5
Compile time error 
Infinite loop

Question # 7 of 10 ( Start time: 09:52:37 AM ) Total Marks: 1 
In_________, we try to have a precise problem statement 
Select correct option: 
Analysis
Design 
Coding 
None of the given

Question # 8 of 10 ( Start time: 09:53:07 AM ) Total Marks: 1 
A _____________is a precise sequence of steps to solve a particular problem. 
Select correct option: 
Code 
Program 
Statement

Question # 1 of 10 ( Start time: 09:48:06 AM ) Total Marks: 1 
While loop executes at least, 
Select correct option: 
Zero time
One time 
N Time 
None of these

Question # 2 of 10 ( Start time: 09:48:59 AM ) Total Marks: 1 
Which of the function call is call by value for the following function prototype? float add(int); 
Select correct option: 
add(&x); 
add(x); 
add(int x); 
add(*x);

Question # 3 of 10 ( Start time: 09:50:21 AM ) Total Marks: 1 
If int sum = 54; Then the value of the following statement is sum = sum - 3 ; 
Select correct option: 
52 
50 
51 
57

Question # 1 of 10 ( Start time: 09:37:10 AM ) Total Marks: 1 
At the design phase, we try to break up the problem into___________ 
Select correct option: 
functional units 
non-functional units 
small units 
None of the given

Question # 2 of 10 ( Start time: 09:37:47 AM ) Total Marks: 1 
According to c++ norms; the first character of a variable name must be an alphabet or 
Select correct option: 
Underscore 
Special character 
Digit 
None of the given options

Question # 3 of 10 ( Start time: 09:39:09 AM ) Total Marks: 1 
What will be the result of arithmetic expression 5+25/5*5? 
Select correct option: 
45 
6 
30 
9

Question # 4 of 10 ( Start time: 09:39:52 AM ) Total Marks: 1 
When the logical operator OR (||) combine two expressions exp1 and exp2 then the result will be false only, 
Select correct option: 
When both exp1 and exp2 are true 
When both exp1 and exp2 are false 
When exp1 is true and exp2 is false 
When exp1 is false and exp2 is true

Question # 5 of 10 ( Start time: 09:40:41 AM ) Total Marks: 1 
From following; which one is the correct syntax of an array initialize: Array size is 10 and it is of double data type to value 0? 
Select correct option: 
arr[10] = {0.0}; 
double arr[10]= 0.0; 
double arr[10] = {0.0};
double arr[] = 0.0;

Question # 6 of 10 ( Start time: 09:42:07 AM ) Total Marks: 1 
char name [] = “Hello World” ; In the above statement, a memory of _________ characters will be allocated 
Select correct option: 
13 
11
12 
10

Question # 7 of 10 ( Start time: 09:42:57 AM ) Total Marks: 1 
___________ are used to compile the code. 
Select correct option: 
Editors 
Debugger 
Linker 
Compiler

Question # 8 of 10 ( Start time: 09:43:09 AM ) Total Marks: 1 
Why we use "cin"? 
Select correct option: 
To send data to printer 
To read data from keyboard 
To display message 
To display output on the screen

Question # 9 of 10 ( Start time: 09:44:37 AM ) Total Marks: 1 
In C/C++; by default arguments are passed by _______ to a function. 
Select correct option: 
Reference 
Value 
Type 
Data

Question # 10 of 10 ( Start time: 09:46:00 AM ) Total Marks: 1 
The name of the array is a constant pointer which contains the memory address of the ____________of the array. 
Select correct option: 
first element 
Last element 
second element 
None of the given

1. in call by reference______of a variable is passed to called function.
2. the ASCHII code null charater is___
3. the_____statement is used to exit from

Quiz 2               CS 201

  1. When we access a multidimensional array, each array index is surrounded by __________. 

Select correct option: 

  Single quotes ' '

 Double quotes " "

 Brackets []

 Commas , ,

 

2. Which header file must be included to use the functions tolower() and toupper()? 

Select correct option: 

  iostream.h

 conio.h

 ctype.h

 stdlib.h

 

3. Transpose of a matrix means that when we interchange rows and columns_____________ 

Select correct option: 

  the first row becomes the Last column

 the first row becomes the first column

 the Last row becomes the first column

 the first column becomes the first row

 

4. Pointers are a special type of __________in which a memory address is stored 

Select correct option: 

  variables

 Location

 Characters

 None of the given

 

5. ___________ Returns true if c is a digit and false otherwise. 

Select correct option: 

  int isalpha( int c )

 int isalnum( int c )

 int isxdigit( int c )

 int isdigit( int c ) 

 

6. _______________ Returns true if c is a letter and false otherwise. 

Select correct option: 

  int isalpha( int c )

 int isalnum( int c )

 int isxdigit( int c )

 int isdigit( int c ) 

 

 

7.   We can define a matrix as__________ array. 

Select correct option: 

  Sorted

 Unsorted

 Single dimensional

 Multi dimensional

 

 

 8.  The increment of a pointer depends on its___________. 

Select correct option: 

  variable

 value

 data type

 None of the given

 

9. The parameter passed to isdigit() function is ____________variable. 

Select correct option: 

  Character

 Boolean

 Integer

 Float

 

10. In Analysis, we try to have a______________ 

Select correct option: 

  Determined the inputs

 Break up of problem

 Precise problem statement

 None of the given

My CS201 Quiz No.2.

Question # 1 of 10 ( Start time: 02:17:54 PM )          Total Marks: 1

By default, the starting index of an array in C++ is _______.

Select correct option:

            2

            -1

            0

            1

 

Question # 2 of 10 ( Start time: 02:19:01 PM )          Total Marks: 1

We can define a matrix as__________ array.

Select correct option:

            Sorted

            Unsorted

            Single dimensional

            Multi dimensional

Question # 3 of 10 ( Start time: 02:19:52 PM )          Total Marks: 1

We can access a global variable ___________

Select correct option:

            From the functions only

            From the loops only

            From the main() function only

            From anywhere in the program

 

Question # 4 of 10 ( Start time: 02:21:00 PM )          Total Marks: 1

A function’s prototype is written __________the function call.

Select correct option:

            After

            Before

            With

            At the end of

 

Question # 5 of 10 ( Start time: 02:22:23 PM )          Total Marks: 1

Which of the function call is call by value for the following function prototype? float add(int);

Select correct option:

            add(&x);

            add(x);

            add(int x);

            add(*x);

 

Question # 6 of 10 ( Start time: 02:23:22 PM )          Total Marks: 1

+= , *= , /= , etc are called,

Select correct option:

            Assignment operators

            Logical operator

            Compound assignment operator

            Unary operator

 

Question # 7 of 10 ( Start time: 02:24:02 PM )          Total Marks: 1

What is the output of the following code if the 2nd case is true switch (var) { case ‘a’: cout”apple”endl; case ‘b’: cout”banana”endl; case ‘m’: cout”mango”endl; default: cout”any fruit”endl; }

Select correct option:

            banana

            banana any fruit

            banana mango anyfruit

            none of the above

 

Question # 8 of 10 ( Start time: 02:25:00 PM )          Total Marks: 1

In C/C++, by default arguments are passed by _______ to a function.

Select correct option:

            Reference

            Value

            Size

            Data

 

Question # 9 of 10 ( Start time: 02:25:19 PM )          Total Marks: 1

What will be the value of ‘a’ and ‘b’ after executing the following statements? int a = 9; int b = a++; cout/p>

Select correct option:

            10,9

            9,10

            9,9

            10,10

 

Question # 10 of 10 ( Start time: 02:26:43 PM )        Total Marks: 1

What is the output of the following code if the 3rd case is true switch (var) { case ‘a’: cout”apple”endl; case ‘b’: cout”banana”endl; case ‘m’: cout”mango”endl; default: cout”any fruit”endl; }

Select correct option:

            mango

            mango any fruit

            apple

            none of the above

__________ operator is used to pass the address of a variable in call by reference method.
&

In C++, what will be the highest index of the following array? int array[15];
15

For breaking complex problems into smaller pieces we use _______.
Functions

Function prototype is written,
Before the return statement in main

When we call a function, its control
The compiler stops execution of whole program

+= , *= , /= , etc are called,
Compound assignment operator

What will be the result of the expression k = ++m; if initially k = 0 and m = 5?
0

By default, the starting index of an array in C++ is _______.
0

What will be the size of the following character array? char name[] = “Adeel”;
5

_________statement is used to terminate the processing of a particular case and exit from switch structure.
continue

CS201_Online_Quiz_Fall_2013

See the attached file 

Attachments:





Quiz Start Time: 07:09 PM

Time Left

32 
sec(s)

Question # 1 of 10 ( Start time: 07:09:39 PM )

Total Marks: 1

What will be the output of following code segment? for (int i = 2; i<10; i++){ if ( i == 5) continue; cout i "," ; }

Select correct option:

2,3,7,8,9

2,3,4,6,7,8,9

2,3,4

4,6,7,8,9

RSS

© 2021   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service