QUIZ ON : C LANGUAGE - CONDITIONAL STATEMENTS AND LOOPS

CONDITIONAL STATEMENTS AND LOOPS

00:00:00

Indian soldiers have been awarded ‘UN Medal’ recently for their peacekeeping works in

Option A. South Sudan
Option B. Congo
Option C. Somalia
Option D. None of the above
True Answer A

Explanation :
Fifty Indian peacekeepers positioned in South Sudan have been granted the UN Medal for their demonstrable skill and administration in securing regular citizens and building solid harmony in the contention ridden nation.

Indian soldiers have been awarded ‘UN Medal’ recently for their peacekeeping works in

Question No# : 01 out of 20

SMTP protocol is used by a mail client program to fetch mail from mail server

Option A. TRUE
Option B. FALSE
Option C.
Option D.
True Answer B

Explanation :

SMTP protocol is used by a mail client program to fetch mail from mail server

Question No# : 02 out of 20

Choose the most appropriate word (s) from the options given below to complete the following sentence. I contemplated ________________Singapore for my vacation but decided against it.

Option A. to visit
Option B. having to visit
Option C. visiting
Option D. for a visit
True Answer C

Explanation :
Contemplate is a transitive verb and hence is followed by a gerund Hence the correct usage of contemplate is verb + ing form.

Choose the most appropriate word (s) from the options given below to complete the following sentence. I contemplated ________________Singapore for my vacation but decided against it.

Question No# : 03 out of 20

The box on the chart that contains the name of each individual record is called the axis.

Option A. TRUE
Option B. FALSE
Option C.
Option D.
True Answer A

Explanation :

The box on the chart that contains the name of each individual record is called the axis.

Question No# : 04 out of 20



= Product (5,2) will result in?

Option A. 10
Option B. 7
Option C. 3
Option D. No one
True Answer A

Explanation :

= Product (5,2) will result in?

Question No# : 05 out of 20



Computer Monitor is also known as

Option A. DVU
Option B. VDU
Option C. UVD
Option D. CCTV
True Answer B

Explanation :

 VDU stand for Visual Display Unit which is nick name of Monitor

Computer Monitor is also known as

Question No# : 06 out of 20



The data to be drawn as a chart cannot be selected after the chart wizard is started.

Option A. TRUE
Option B. FALSE
Option C.
Option D.
True Answer B

Explanation :

The data to be drawn as a chart cannot be selected after the chart wizard is started.

Question No# : 07 out of 20



ट वर्ग में किस प्रकार के व्यंजन हैं?

Option A. कंठ्य
Option B. तालव्य
Option C. मूर्धन्य
Option D. दन्त्य
True Answer C

Explanation :
ट वर्ग के वर्ण ट, ठ, ड, ढ, ण सभी मूर्धन्य व्यंजन होते है। यह वर्ण कठोर तालु के मध्य भाग तथा जीभ की उल्टी हुई नोंक के निचले भाग से स्पर्श होकर उच्चारित होते हैं, ऐसी स्थिति में उत्पन्न ध्वनि को मूर्धन्यउ कहते हैं।

ट वर्ग में किस प्रकार के व्यंजन हैं?

Question No# : 08 out of 20

In order to develop the spirit of labour in students

Option A. the teacher himself should indulge in labour
Option B. the teacher should deliver lectures on the Importance of labour
Option C. students should be given opportunities to do labour from time to time
Option D. students should be given examples of people who labour
True Answer C

Explanation :
In order to develop the spirit of labour in students should be given opportunities to do labour from time to time.

In order to develop the spirit of labour in students

Question No# : 09 out of 20

To Replace a word Bombay with Mumbai, we should go to which of the following menus?

Option A. Tools menu
Option B. Edit menu
Option C. View menu
Option D. Language Menu
True Answer B

Explanation :


To Replace a word Bombay with Mumbai, we should go to which of the following menus?

Question No# : 10 out of 20



The procedure given below is required to find and replace certain characters inside an input character string supplied in array A. The characters to be replaced are supplied in array oldc, while their respective replacement characters are supplied in array newc. Array A has a fixed length of five characters, while arrays oldc and newc contain three characters each. However, the procedure is flawed.
void find_and_replace (char *A, char *oldc, char *newc) {
for (int i=0; i<5; i++)
for (int j=0; j<3; j++)
if (A[i] == oldc[j]) A[i] = newc[j];
}
The procedure is tested with the following four test cases.
(1) oldc = “abc”, newc = “dab”
(2) oldc = “cde”, newc = “bcd”
(3) oldc = “bca”, newc = “cda”
(4) oldc = “abc”, newc = “bac”
The tester now tests the program on all input strings of length five consisting of characters ‘a’, ‘b’, ‘c’, ‘d’ and ‘e’ with duplicates allowed. If the tester carries out this testing with the four test cases given above, how many test cases will be able to capture the flaw?

Option A. Only one
Option B. Only two
Option C. Only three
Option D. All four
True Answer B

Explanation :

 Flaw in this given procedure is that one character of Array 'A' can be replaced by more than one character of newc array, which should not be so. Test case (3) and (4) identifies this flaw as they are containing 'oldc' and 'newc' array characters arranged in specific manner.
Following string can reflect flaw, if tested by test case (3)
initially i = j = 0

b = b so replaced by c
Next i = 0 & j = 1

c = c so replaced by d
Likewise single character 'b' in A is replaced by 'c' and then by 'd'.
Same way test case (4) can also catch the flaw.

The procedure given below is required to find and replace certain characters inside an input character string supplied in array A. The characters to be replaced are supplied in array oldc, while their respective replacement characters are supplied in array newc. Array A has a fixed length of five characters, while arrays oldc and newc contain three characters each. However, the procedure is flawed.
void find_and_replace (char *A, char *oldc, char *newc) {
for (int i=0; i<5; i++)
for (int j=0; j<3; j++)
if (A[i] == oldc[j]) A[i] = newc[j];
}
The procedure is tested with the following four test cases.
(1) oldc = “abc”, newc = “dab”
(2) oldc = “cde”, newc = “bcd”
(3) oldc = “bca”, newc = “cda”
(4) oldc = “abc”, newc = “bac”
The tester now tests the program on all input strings of length five consisting of characters ‘a’, ‘b’, ‘c’, ‘d’ and ‘e’ with duplicates allowed. If the tester carries out this testing with the four test cases given above, how many test cases will be able to capture the flaw?

Question No# : 11 out of 20



Fibre optic cable reduces cross talk effect.

Option A. TRUE
Option B. FALSE
Option C.
Option D.
True Answer A

Explanation :

Fibre optic cable reduces cross talk effect.

Question No# : 12 out of 20



Consider three machines M, N, and P with IP addresses 100.10.5.2, 100.10.5.5, and 100.10.5.6 respectively. The subnet mask is set to 255.255.255.252 for all the three machines. Which one of the following is true?

Option A. M, N, and P all belong to the same subnet
Option B. Only M and N belong to the same subnet
Option C. Only N and P belong to the same subnet
Option D. M, N, and P belong to three different subnets
True Answer C

Explanation :

 

N and P belongs to same subnet.

Hence, C is correct answer.

Consider three machines M, N, and P with IP addresses 100.10.5.2, 100.10.5.5, and 100.10.5.6 respectively. The subnet mask is set to 255.255.255.252 for all the three machines. Which one of the following is true?

Question No# : 13 out of 20

Which of the following is not a storage medium?

Option A. Hard disk
Option B. Flash drive
Option C. DVD
Option D. Scanner
True Answer D

Explanation :

Which of the following is not a storage medium?

Question No# : 14 out of 20



Read the following Python code carefully and point out the global variables?

  y, z = 1, 2  def f():      global x      x = y+z

Option A. x
Option B. y and z
Option C. x, y and z
Option D. Neither x, nor y, nor z
True Answer C

Explanation :
In the code shown above, x, y and z are global variables inside the function f. y and z are global because they are not assigned in the function. x is a global variable because it is explicitly specified so in the code. Hence, x, y and z are global variables.

Read the following Python code carefully and point out the global variables?

  y, z = 1, 2  def f():      global x      x = y+z

Question No# : 15 out of 20



Company Restore option is available in

Option A. Configuration
Option B. Company Features
Option C. Company Information
Option D. Both a and b
True Answer C

Explanation :

Company Restore option is available in

Question No# : 16 out of 20

Each excel file is called a workbook because

Option A. It can contain text and data.
Option B. It can be modified.
Option C. It can contain many sheets including worksheets chart sheets.
Option D. None of the above
True Answer C

Explanation :

Each excel file is called a workbook because

Question No# : 17 out of 20



What function do you use to read a string?

Option A. input(“Enter a string”)
Option B. eval(input(“Enter a string”))
Option C. enter(“Enter a string”)
Option D. eval(enter(“Enter a string”))
True Answer A

Explanation :
Execute in shell to verify.

What function do you use to read a string?

Question No# : 18 out of 20



Which of the following is a dicotyledon

Option A. Grass
Option B. Mango
Option C. Maize
Option D. All of these.
True Answer B

Explanation :
The dicotyledons, also known as dicots, were one of the two groups into which all the flowering plants or angiosperms were formerly divided. Mango is a dicotyledon.

Which of the following is a dicotyledon

Question No# : 19 out of 20

What will be the output of the following Python code?

>>> a={3,4,5}  >>> b={5,6,7}  >>> a|b

Option A. Invalid operation
Option B. {3, 4, 5, 6, 7}
Option C. {5}
Option D. {3,4,6,7}
True Answer D

Explanation :
The operation in the above piece of code is union operation. This operation produces a set of elements in both set a and set b.

What will be the output of the following Python code?

>>> a={3,4,5}  >>> b={5,6,7}  >>> a|b

Question No# : 20 out of 20