Programming and Data Structure MCQ Quiz in मल्याळम - Objective Question with Answer for Programming and Data Structure - സൗജന്യ PDF ഡൗൺലോഡ് ചെയ്യുക
Last updated on Mar 8, 2025
Latest Programming and Data Structure MCQ Objective Questions
Top Programming and Data Structure MCQ Objective Questions
Programming and Data Structure Question 1:
Consider the following C program:
#include
int main ( )
{
int a[ ] = {2, 4, 6, 8, 10};
int i, sum = 0, *b = a + 4;
for (i = 0; i < 5; i++)
sum = sum + (*b - i) - *(b - i);
printf (“ % d \ n”, sum);
return 0;
}
The output of the above C program is ________.Answer (Detailed Solution Below) 10
Programming and Data Structure Question 1 Detailed Solution
integer pointer b points to 5th element of an static array a
*b = 10 / dereferencing
sum = 0 / initially
Values in loop |
sum = sum + (*b - i) - *(b - i); |
i = 0 |
sum = 0 + (10 - 0) - *(address_of_5th integer - 0) = 10 - *(address_of_5th integer) = 10 - 10 = 0 |
i = 1 |
sum = 0 + (10 - 1) - *(address_of_5th integer - 1) = 0 + (10 - 1) - *(address_of_4th integer) = 9 - 8 = 1 |
i = 2 |
sum = 1 + (10 - 2) - *(address_of_5th integer - 2) = 1 + (10 - 2) - *(address_of_3rd integer) = 9 - 6 = 3 |
i = 3 |
sum = 3 + (10 - 3) - *(address_of_5th integer - 3) = 3 + (10 - 3) - *(address_of_2nd integer) = 10 - 4 = 6 |
i = 4 |
sum = 6 + (10 - 4) - *(address_of_5th integer - 4) = 6 + (10 - 4) - *(address_of_1st integer) = 12 - 2 = 10 |
Programming and Data Structure Question 2:
Who is credited with developing the “C” language?
Answer (Detailed Solution Below)
Programming and Data Structure Question 2 Detailed Solution
The correct answer is Dennis Ritchie.
Key Points
- C programming is a general-purpose, procedural, imperative computer programming language created by Dennis M. Ritchie at Bell Telephone Laboratories in 1972 to help build the UNIX operating system.
- The most extensively used computer language is C. Dennis Ritchie created C, a successor to the programming language B, at Bell Labs between 1972 and 1973 to build tools that ran on Unix.
- It was used to re-implement the Unix operating system's kernel.
- Dennis MacAlistair Ritchie was a computer scientist from the United States.
- He designed the C programming language, as well as the Unix operating system and the B programming language, alongside long-time collaborator Ken Thompson.
Additional Information
- William Henry Gates III (Bill Gates) is a business entrepreneur, software developer, investor, author, and philanthropist from the United States. He and his late boyhood buddy Paul Allen co-founded Microsoft.
- Yashavant Kanetkar is a computer science author from India well known for his publications on programming languages. He has written multiple books on programming in C, C++, VC++, C#,.NET, DirectX, and COM.
Programming and Data Structure Question 3:
Which image below represents the Quick Analysis tool command?
Answer (Detailed Solution Below)
Programming and Data Structure Question 3 Detailed Solution
Programming and Data Structure Question 4:
Automatic variables use which data structure for space allocation in memory?
Answer (Detailed Solution Below)
Programming and Data Structure Question 4 Detailed Solution
Memory of a computer is organized for running program into three segments: the text segment, stack segment, heap segment.
Stack and heap is where storage is allocated for data storage. Stack is where memory is allocated for automatic variables within functions.Programming and Data Structure Question 5:
Which one of the following is not an example of computer language?
Answer (Detailed Solution Below)
Programming and Data Structure Question 5 Detailed Solution
The correct answer is ALGORITHM.
Key Points
- An algorithm is a specific procedure for solving a well-defined computational problem.
- The development and analysis of algorithms are fundamental to all aspects of Computer Science like AI, databases, graphics, networking, OS, etc.
- Algorithm development is more than just programming.
- It requires an understanding of the alternatives available for solving a computational problem.
- It includes the hardware, networking, programming language, and performance constraints that accompany any particular solution.
Additional Information
- An official language comprising a collection of instructions that produce different kinds of output is a programming language.
- In computer science, programming languages are used to implement algorithms.
- Most of the languages of programming consist of computer instructions.
Pascal |
|
Fortron |
|
Cobol |
|
Programming and Data Structure Question 6:
The property or the ability to take more than one form is called as
Answer (Detailed Solution Below)
Programming and Data Structure Question 6 Detailed Solution
Polymorphism:-
- The word polymorphism means having many forms. In simple words, we can define polymorphism as the ability of a message to be displayed in more than one form.
- A real-life example of polymorphism is when two people have distinct characteristics at the same time. At the same time, he is a father, a spouse, and an employee. As a result, the same person behaves differently in different settings.
- Polymorphism is considered one of the important features of Object-Oriented Programming.
Polymorphism is mainly divided into two types:
- Compile-time Polymorphism
- Runtime Polymorphism
Compile-time polymorphism
This is achieved by function overloading or operator overloading.
- Function Overloading - When there are multiple functions with the same name but different parameters then these functions are said to be overloaded
- Operator overloading - When there are multiple operations that can be performed by using a single operator is called operator overloading for example operator ‘+’ when placed between integer operands, adds them, and when placed between string operands, concatenates them.
Run Time Polymorphism
It is achieved by Function Overriding
Additional Information
Encapsulation
- It is the process or method to contain the information.
- Wrapping of data and function into a single unit is called data encapsulation
- Encapsulation is a method to hide the data in a single entity or unit along with a method to protect information from outside.
- It can be implemented using by access modifier.
Inheritance
The capability of a class to derive properties from another class is called Inheritance
- The class that inherits properties from another class is called Subclass or Derived Class.
- The class whose properties are inherited by a subclass is called Base Class or Superclass.
Syntax for Inheritance
class derived_name : access_mode base_class
{
/body of the derived class
};
Programming and Data Structure Question 7:
What is the output of the following C code:
int main( )
{
int p=8,q=-3,r=0;
int x,y,z;
x = p && q && r ;
y = p || q && r ;
z = p && q || r ;
printf ("%d", x+y+z) ;
return 0;
}Answer (Detailed Solution Below)
Programming and Data Structure Question 7 Detailed Solution
Working of logical operators:
x |
y |
x||y |
x&&y |
0 |
0 |
0 |
0 |
0 |
Non-zero |
1 |
0 |
Non-zero |
0 |
1 |
0 |
Non-zero |
Non-zero |
1 |
1 |
Precedence order of && is higher than ||.
Logical operators will result in 0 or 1 always.
x + y + z = 0 + 1 + 1 = 2
Programming and Data Structure Question 8:
What is the shortcut for navigating to the next sheet?
Answer (Detailed Solution Below)
Programming and Data Structure Question 8 Detailed Solution
Ctrl+PageUp is used to navigate to the previous sheet
Ctrl+Home is used to bring the control(cursor) to the first cell of the active worksheet
Ctrl+End does nothing (self created)
Programming and Data Structure Question 9:
What is the minimum size of char in C?
Answer (Detailed Solution Below)
Programming and Data Structure Question 9 Detailed Solution
The correct answer is 8 bit.
Key Points
- The type of a variable determines how much space it occupies in storage and how the bit pattern stored is interpreted.
- The Size of the char data type is 1 byte or 8bit.
Additional Information
Type |
Storage size |
Value range |
char |
1 byte |
-128 to 127 or 0 to 255 |
unsigned char |
1 byte |
0 to 255 |
signed char |
1 byte |
-128 to 127 |
int |
2 or 4 bytes |
-32,768 to 32,767 or -2,147,483,648 to 2,147,483,647 |
unsigned int |
2 or 4 bytes |
0 to 65,535 or 0 to 4,294,967,295 |
short |
2 bytes |
-32,768 to 32,767 |
unsigned short |
2 bytes |
0 to 65,535 |
long |
8 bytes or (4bytes for 32 bit OS) |
-9223372036854775808 to 9223372036854775807 |
unsigned long |
8 bytes |
0 to 18446744073709551615 |
Programming and Data Structure Question 10:
What is the time complexity of a removing middle element from a doubly linked list?