QUIZ ON : C LANGUAGE - STRUCTURES AND UNIONS

STRUCTURES AND UNIONS

00:00:00

What will be the output of the following Python code?

  1.   values = [[3, 4, 5, 1 ], [33, 6, 1, 2]]
  2.    
  3. for row in values:
  4.       row.sort()
  5.       for element in row:
  6.           print(element, end = " ")
  7.       print()

Option A. The program prints two rows 3 4 5 1 followed by 33 6 1 2
Option B. The program prints on row 3 4 5 1 33 6 1 2
Option C. The program prints two rows 3 4 5 1 followed by 33 6 1 2
Option D. The program prints two rows 1 3 4 5 followed by 1 2 6 33
True Answer D

Explanation :
Execute in the shell to verify.

What will be the output of the following Python code?

  1.   values = [[3, 4, 5, 1 ], [33, 6, 1, 2]]
  2.    
  3. for row in values:
  4.       row.sort()
  5.       for element in row:
  6.           print(element, end = " ")
  7.       print()

Question No# : 01 out of 20



Which is the largest Memory Unit among the following?

Option A. KB
Option B. MB
Option C. TB
Option D. ZB
True Answer D

Explanation :

Which is the largest Memory Unit among the following?

Question No# : 02 out of 20



Why is a one time password system considered more secure than a basic authentication system?

Option A. It is easy to generated
Option B. It cannot be shared
Option C. It is different for every access
Option D. It is a complex encrypted password
True Answer C

Explanation :
One time password is safe since it is generated per access and thus cannot be brute forced or deduced.

Why is a one time password system considered more secure than a basic authentication system?

Question No# : 03 out of 20

An object is represented by two attributes, out of which one is characteristics and the other one is

Option A. Behaviour
Option B. Situation
Option C. Abstraction
Option D. Encapsulation
True Answer A

Explanation :

An object is represented by two attributes, out of which one is characteristics and the other one is

Question No# : 04 out of 20

E-mail message can be protected by

Option A. Mirroring
Option B. Caching
Option C. Encryption
Option D. Resending
True Answer C

Explanation :

E-mail message can be protected by

Question No# : 05 out of 20

By using which of the below functionality temporary files of the computer can be removed

Option A. Disk Clean up
Option B. Clean Disk
Option C. Disk Eraser
Option D. Disk Clear
True Answer A

Explanation :

By using which of the below functionality temporary files of the computer can be removed

Question No# : 06 out of 20



What will be the output of the following Python code?

nums = set([1,1,2,3,3,3,4,4])

print(len(nums))

Option A. 7
Option B. Error, invalid syntax for formation of set
Option C. 4
Option D. 8
True Answer C

Explanation :
A set doesn’t have duplicate items.

What will be the output of the following Python code?

nums = set([1,1,2,3,3,3,4,4])

print(len(nums))

Question No# : 07 out of 20



Which of the following is the correct way to define a two dimensional array?

Option A. int a[ ][4];
Option B. int b[2, 4];
Option C. int c[2][ ];
Option D. int d[ ] [ 4] = {{1, 3, 5, 7}, {2, 4, 6, 8}};
True Answer D

Explanation :

Which of the following is the correct way to define a two dimensional array?

Question No# : 08 out of 20

How are data organized in a spreadsheet?

Option A. Lines and spaces
Option B. Layers and planes
Option C. Rows and columns
Option D. Height and width
True Answer C

Explanation :

How are data organized in a spreadsheet?

Question No# : 09 out of 20



The keyword ‘break’ cannot be simply used within:

Option A. do-while
Option B. if-else
Option C. for
Option D. while
True Answer B

Explanation :

The keyword ‘break’ cannot be simply used within:

Question No# : 10 out of 20

The villagers _____ read and write their mother tongue.

Direction: Fill in the blank with the appropriate modal.

Option A. May
Option B. Can
Option C. Should
Option D. With
True Answer B

Explanation :
The sentence needs a verb which shows the ability to do something. So, the correct verb is "can" as it is used to show the ability of doing something. "May" is incorrect as it is used to show the possibilities. "Should" is also incorrect as it is used to give advise. "With" is not a verb. It is a preposition; so, it is also an incorrect choice.

The villagers _____ read and write their mother tongue.

Direction: Fill in the blank with the appropriate modal.

Question No# : 11 out of 20



[Ctrl] + [End] moves the last cell containing contents in the worksheet in Excel.

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

Explanation :

[Ctrl] + [End] moves the last cell containing contents in the worksheet in Excel.

Question No# : 12 out of 20



What function should be used to free the memory allocated by calloc() ?

Option A. dealloc();
Option B. malloc(variable_name, 0)
Option C. free();
Option D. memalloc(variable_name, 0)
True Answer C

Explanation :

What function should be used to free the memory allocated by calloc() ?

Question No# : 13 out of 20



A DC motor is any of a class of rotary electrical motors that converts direct current electrical energy into mechanical energy.

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

Explanation :

A DC motor is any of a class of rotary electrical motors that converts direct current electrical energy into mechanical energy.

Question No# : 14 out of 20



Firewall is a type of ____________.

Option A. Virus
Option B. Security threat
Option C. Worm
Option D. None of the above
True Answer D

Explanation :

A firewall is a type of cybersecurity tool that is used to filter traffic on a network. Firewalls can be used to separate network nodes from external traffic sources, internal traffic sources, or even specific applications.

Firewall is a type of ____________.

Question No# : 15 out of 20



Ctrl + D is short cut used for ?

Option A. Open Dialogue Box
Option B. Font Dialogue Box
Option C. Save as Dialogue Box
Option D. Save Dialogue Box
True Answer B

Explanation :

Ctrl + D is short cut used for ?

Question No# : 16 out of 20



Format painter is

Option A. To copy formatting from one object or piece of text and then apply it elsewhere.
Option B. To change the background color of your slides.
Option C. To print pretty pictures on background of slides.
Option D. To paint pretty picture on your slides.
True Answer A

Explanation :

 

Format painter is

Question No# : 17 out of 20



In reality,Internet protocol recognizes only

Option A. An IP address
Option B. A location of the host
Option C. A postal mail address
Option D. None of the above
True Answer A

Explanation :

In reality,Internet protocol recognizes only

Question No# : 18 out of 20



Given digits 2, 2, 3, 3, 3, 4, 4, 4, 4 how many distinct 4 digit numbers greater than 3000 can be formed?

Option A. 50
Option B. 51
Option C. 52
Option D. 54
True Answer B

Explanation :

 first place should be occupied by either 3 or 4.

Case 1 : First place is occupied by the digit 4 

 4  _  _  _

now in the set from where we can pick numbers is left with ={2,2,3,3,3,4,4,4}

if we got 3 of each digit(which are 2,3 and 4) then number of ways by each of those blanks can be

filled in are 3 coz we have 3 choices of digits: pick 2,3 or 4.

But we do not have just enough 2′s to fill all those 3 spaces with the digit 2.

∴ we need to subtract this case where number would be 4222.

So, total numbers obtained using the numbers in our current set =1×3×3×3−1=26.

The first one is for the digit 4, coz its fixed for this case; the subtracted one is for the case 4222 that can't be made possible.

Case 2: First place is occupied by the digit 3 

3  _  _  _

now in the set from where we can pick numbers is left with ={2,2,3,3,4,4,4,4}

we have enough 4′s here but lack 3′s and 2′s ∴, the cases we need to subtract are 3222 and 3333

So, total numbers obtained using the numbers in our current set =1×3×3×3−2=25

both cases are independently capable of giving us the answer, we have =26+25=51.

Hence answer is option B.

Given digits 2, 2, 3, 3, 3, 4, 4, 4, 4 how many distinct 4 digit numbers greater than 3000 can be formed?

Question No# : 19 out of 20

Purpose of Arrange All option in the Word menu is

Option A. to align all the paragraphs in a Word document
Option B. to align all the open Word documents on screen for easy accessibility
Option C. to arrange all open Word files alphabetically
Option D. none of the above
True Answer B

Explanation :

Purpose of Arrange All option in the Word menu is

Question No# : 20 out of 20