PGDCA 2nd Semester Exam 09/03/2020

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By PHULBANIOCA
P
PHULBANIOCA
Community Contributor
Quizzes Created: 3 | Total Attempts: 647
| Attempts: 120 | Questions: 40
Please wait...
Question 1 / 40
0 %
0/100
Score 0/100
1. An algorithm is best described as:

Explanation

An algorithm is a set of instructions or a step-by-step procedure that is used to solve a problem or perform a specific task. It is not a computer language, as it can be implemented in various programming languages. While it may involve mathematical concepts or be used in mathematical calculations, it is not solely a branch of mathematics. Therefore, the correct answer is that an algorithm is a step-by-step procedure for solving a problem.

Submit
Please wait...
About This Quiz
PGDCA 2nd Semester Exam 09/03/2020 - Quiz

This PGDCA 2nd Semester Exam dated 09\/03\/2020 assesses knowledge in computer science and programming. Questions cover algorithms, machine language, matrix operations, C programming, and logical reasoning, essential for understanding core computing concepts.

Personalize your quiz and earn a certificate with your name on it!
2. The expression, i=30*10+27; evaluates to:

Explanation

The expression i=30*10+27 evaluates to 327. This is because the multiplication operation is performed first, resulting in 300. Then, the addition operation is performed, adding 27 to 300, resulting in the final value of 327.

Submit
3. BCPL 

Explanation

BCPL stands for Basic Combined Programming Language. It is a programming language that was developed in the 1960s and was widely used for system programming. BCPL is considered a low-level language because it provides low-level control over the computer's hardware and memory. It is not an assembly language, which is a type of low-level language that is specific to a particular computer architecture. Therefore, the correct answer is "Basic Combined Programming Language."

Submit
4. Product of matrices A(m x n) and B(n x p) will be matrix C with row and column as:

Explanation

The product of matrices A(m x n) and B(n x p) will result in a matrix C with m rows and p columns. This is because the number of rows in matrix A must match the number of columns in matrix B in order for the multiplication to be defined. The resulting matrix C will have the same number of rows as matrix A and the same number of columns as matrix B, which is m and p respectively.

Submit
5. In C program, all variable must be declared before they are used 

Explanation

In C programming, all variables must be declared before they are used. This means that the programmer needs to specify the type and name of the variable before using it in any statements or calculations. This is necessary because the compiler needs to know the data type of the variable in order to allocate memory for it and perform appropriate operations. If a variable is used without being declared first, the compiler will generate an error. Therefore, the statement "all variable must be declared before they are used" is true in C programming.

Submit
6. While(1) { }

Explanation

The given code snippet is a while loop with a condition of "1", which means the loop will continue indefinitely. This is a valid construct in many programming languages, including C, C++, and Java. The loop body is empty, but it is still considered valid code.

Submit
7. Matrix is 

Explanation

A matrix is a combination of rows and columns. It is a two-dimensional array that is arranged in a rectangular form, where each element is identified by its row and column index. The rows represent the horizontal dimension, while the columns represent the vertical dimension. Therefore, a matrix is not just a one-dimensional array, but rather a structure that combines both rows and columns to organize and represent data.

Submit
8. The operator && in 'C' language is a 

Explanation

The operator && in 'C' language is the AND operator. This operator is used to combine two conditions and returns true only if both conditions are true. If either of the conditions is false, the result will be false. Therefore, the correct answer is AND operator.

Submit
9. If A=5 and B=++A, the value of A and B

Explanation

When A=5 and B=++A, the value of A is incremented by 1 before assigning it to B. Therefore, the value of A becomes 6 and B is also assigned the value of 6. Hence, the correct answer is 6,6.

Submit
10. Which of the following is related to machine language?

Explanation

All of the options mentioned are related to machine language. Machine language is difficult to learn as it consists of low-level instructions that are specific to a particular computer architecture. It is also considered a first-generation language as it was the first type of programming language used to communicate with computers. Additionally, machine language is machine-dependent, meaning it is designed for a specific computer system and cannot be executed on other machines without modification. Therefore, all of the given options are correct in relation to machine language.

Submit
11. For(; ;) 

Explanation

The given code snippet is a for loop with no initialization, condition, or increment statement. This means that the loop will run indefinitely, as there is no condition to stop it. Therefore, the statement "valid" is correct, as the code will continue to execute without terminating.

Submit
12. Which of the following is the correct order if calling a function in the below code? a= f1(23,14)* f2 (12/4) +f3();

Explanation

The correct order of calling the functions in the given code is f1, f2, f3. This is because the function f1 is called with the arguments 23 and 14, then the function f2 is called with the result of the division operation 12/4, and finally the function f3 is called without any arguments.

Submit
13. Which of the following datatype is a structured data type with heterogeneous elements

Explanation

A structure is a datatype that allows us to combine different types of variables into a single entity. It is considered a structured data type because it can contain heterogeneous elements, meaning it can store variables of different data types within it. This allows for the organization and grouping of related data, making it easier to manage and access. In contrast, an array is a data structure that stores elements of the same data type, an enum is an enumerated type that represents a set of named values, and a pointer is a variable that stores the memory address of another variable.

Submit
14. Choose the odd one out

Explanation

The given options a=a+1, a+=1, and a++ all increment the value of 'a' by 1. However, a=+1 is different because it assigns the value of +1 to 'a' instead of incrementing its current value.

Submit
15. The keyword used to transfer control from a function back to the calling function is

Explanation

The keyword "return" is used to transfer control from a function back to the calling function. When a function is called, the program execution moves to that function and starts executing the statements inside it. The "return" keyword is used to exit the function and return the control back to the calling function. It can also be used to return a value from the function to the calling function.

Submit
16. Which of the following is the correct order of evaluation for the below expression z=x+y*z/4%2-1

Explanation

The correct order of evaluation for the expression "z=x+y*z/4%2-1" is as follows: first, the multiplication ( * ) and division ( / ) operations are performed from left to right, then the modulo ( % ) operation is performed, followed by the addition ( + ) and subtraction ( - ) operations. Finally, the result is assigned to the variable z ( = ).

Submit
17. Array is a collection of:

Explanation

An array is a collection of identical data objects because it is a data structure that stores elements of the same type in contiguous memory locations. Each element in an array is accessed by its index, and all elements have the same data type. Therefore, an array is used to store a collection of identical data objects.

Submit
18. When multidimensional array are assigned initial value:

Explanation

When multidimensional arrays are assigned an initial value, the rightmost subscript increases most rapidly. This means that when filling the array with values, the rightmost index changes more frequently than the other indices. For example, in a 2D array, the column index changes more rapidly than the row index. This is important to understand when accessing and manipulating elements in a multidimensional array.

Submit
19. Macros are defined using 

Explanation

Macros in programming are defined using the #define directive. This directive allows programmers to create symbolic names or constants that can be used throughout the code. The #define directive is used to define a macro and associate it with a specific value or code snippet. This allows for easier code maintenance and readability, as the macro can be used instead of writing the value or code snippet repeatedly.

Submit
20. Break used

Explanation

The correct answer "Forces the statement to come out" explains that the use of the "break" keyword in programming is used to exit a loop or switch statement prematurely. When the "break" statement is encountered, the program will immediately exit the loop or switch statement and continue executing the next line of code after the loop or switch. This allows for conditional termination of a loop or skipping the remaining cases in a switch statement.

Submit
21. The result of Relational operation is always 

Explanation

The result of a relational operation is always either true or false because relational operations compare two values and determine whether they satisfy a specific relationship, such as less than, greater than, or equal to. The comparison can only have two outcomes: either the relationship is true or it is false. Therefore, the correct answer is "Either true or false."

Submit
22. The string is terminated automatically in the memory

Explanation

In programming, strings are typically stored as arrays of characters. In order to indicate the end of a string, a special character called NULL is used. When a string is terminated by NULL, it means that the last character of the string is followed by a NULL character, which serves as a marker to indicate the end of the string. This allows programs to know where the string ends and prevents any unexpected behavior when manipulating or accessing the string. Therefore, the correct answer is "By NULL".

Submit
23. How many times "IndiaBIX" is get printed int main() {  int x; for (x=-1;x<=10;x++) {   if(x<5)  continue;  else break;  printf("IndiaBix"); } return 0; }

Explanation

The loop starts with x=-1 and continues until x

Submit
24. Which of the following cannot be used as identifiers?

Explanation

Digits cannot be used as identifiers because identifiers in programming languages are typically used to represent variables, functions, or other entities, and they must follow certain rules. One of these rules is that an identifier cannot start with a digit. It can only start with a letter or an underscore. However, digits can be used within an identifier after the first character.

Submit
25. Int a[3]={1,2,3}; printf("%d",a[3]);

Explanation

The given code initializes an array "a" with 3 elements {1, 2, 3}. However, when trying to print the value at index 3 (a[3]), it is accessing a memory location beyond the size of the array. This results in undefined behavior. In this case, it prints the value 0, which is likely the value stored in the memory location immediately after the array.

Submit
26. What do the following declaration signify? void *cmp();

Explanation

The declaration "void *cmp();" signifies that cmp is a function that returns a void pointer. The return type of the function is void *, indicating that the function will return a pointer to an unspecified type.

Submit
27. If you don't initialize a static array, what will be the elements set to?

Explanation

When a static array is not initialized, the elements are automatically set to zero. This means that each element in the array will have a value of zero until it is explicitly assigned a different value.

Submit
28. When we declare an array

Explanation

When we declare an array, the compiler automatically declares the array name itself as a constant pointer to the base address. This means that the array name represents the memory address of the first element in the array. Additionally, a continuous block of memory is allocated to store the values of the elements in the array. The index of the elements is declared automatically, allowing us to access specific elements using their index values. Finally, when the array is declared, all the elements are initialized to zero by default.

Submit
29. The default return type of main() is 

Explanation

The default return type of the main() function in C++ is int. This means that the main() function is expected to return an integer value to the operating system when the program terminates.

Submit
30. The C statements printf (" The value= %x",62); will print

Explanation

The printf statement with the format specifier "%x" will print the hexadecimal representation of the number 62. In hexadecimal, the number 62 is represented as "3C". Therefore, the correct answer is "The value=3C".

Submit
31. What is the similarity between a structure, union and enumeration?

Explanation

All of the options mentioned in the question (structure, union, and enumeration) allow the programmer to define new data types. These data types can be used to create variables and store values of different types in memory. By defining new data types, it becomes easier to organize and manipulate data in a program, increasing code readability and maintainability.

Submit
32. Choose the odd one out

Explanation

The given options consist of different control structures used in programming. "while" is the odd one out because it is the only option that is a looping construct, while the others are conditional statements or decision-making constructs. "if" is used for making a decision based on a condition, "if-else" is used for making a decision with two possible outcomes, and "switch-case" is used for making a decision with multiple possible outcomes. "while" is used for repeating a block of code until a certain condition is met.

Submit
33. In the passage of text, individual words and punctuation marks are known as 

Explanation

In the passage of text, individual words and punctuation marks are known as keywords. Keywords are specific words or phrases that have a predefined meaning in a programming language. They are used to define the structure and behavior of the program. Examples of keywords in programming languages include "if," "else," "for," "while," and "return." These keywords cannot be used as variable names or identifiers because they have a special meaning in the language.

Submit
34. The file stdin has to be explicitly opened before it can be used

Explanation

The statement is false because the file stdin does not need to be explicitly opened before it can be used. In most programming languages, stdin is a pre-defined file that is automatically open for reading. It is used to read input from the user or from another source. Therefore, there is no need to explicitly open it before using it.

Submit
35. When the following piece of code is executed, what output will be generated? #include<stdio.h> int main() {  char arr[7]="Network"; printf("%s",arr); return 0; }

Explanation

When the code is executed, it will print the string "Network" because the character array "arr" is initialized with the string "Network". The printf statement will print the string using the "%s" format specifier. There will not be any garbage value printed in this case.

Submit
36. Which of the following are not valid variable names in C?

Explanation

All of the options mentioned are not valid variable names in C. In C, variable names cannot contain special characters or spaces. The option "float_int" violates this rule by having an underscore between two words. "keyword" is not a valid variable name as it is a reserved keyword in C. "A1" is a valid variable name as it starts with a letter and can contain letters, numbers, and underscores. The options "ANSI", "ASCII", and "CPU" are not valid variable names as they consist entirely of capital letters, which is not allowed in C. Therefore, the correct answer is "All of the above".

Submit
37. The exit() function causes an exit from a function

Explanation

The exit() function causes an exit from the entire program, not just a function. When the exit() function is called, the program terminates immediately and any remaining code in the function or program is not executed. Therefore, the statement "The exit() function causes an exit from a function" is false.

Submit
38. Which option is used to print question mark

Explanation

The correct answer is \?. The backslash (\) is used as an escape character in programming languages, and when followed by certain characters, it represents a special character. In this case, the question mark (?) is a special character that needs to be printed as a regular character, so it is preceded by a backslash to indicate that it should be treated as a literal question mark. The option \0 is incorrect because it represents the null character, and \\ represents a single backslash.

Submit
39. How many times is a do while loop guaranteed to loop

Explanation

A do-while loop is guaranteed to loop at least once because the condition is checked at the end of the loop. However, if the condition is false after the first iteration, the loop will not execute again. Therefore, the correct answer is 0, indicating that the loop may not execute more than once.

Submit
40. Choose the Correct one: p=5/2

Explanation

The correct answer is 1 because the given equation p=5/2 simplifies to p=2.5. Since 2.5 is not one of the options, the closest option to 2.5 is 2, but it is still not equal to 2.5. Therefore, the correct answer is 1, which is the closest whole number to 2.5.

Submit
View My Results

Quiz Review Timeline (Updated): Mar 20, 2023 +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Mar 20, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Mar 06, 2020
    Quiz Created by
    PHULBANIOCA
Cancel
  • All
    All (40)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
An algorithm is best described as:
The expression, i=30*10+27; evaluates to:
BCPL 
Product of matrices A(m x n) and B(n x p) will be matrix C with row...
In C program, all variable must be declared before they are used 
While(1) { }
Matrix is 
The operator && in 'C' language is a 
If A=5 and B=++A, the value of A and B
Which of the following is related to machine language?
For(; ;) 
Which of the following is the correct order if calling a function in...
Which of the following datatype is a structured data type with...
Choose the odd one out
The keyword used to transfer control from a function back to the...
Which of the following is the correct order of evaluation for the...
Array is a collection of:
When multidimensional array are assigned initial value:
Macros are defined using 
Break used
The result of Relational operation is always 
The string is terminated automatically in the memory
How many times "IndiaBIX" is get printed ...
Which of the following cannot be used as identifiers?
Int a[3]={1,2,3}; printf("%d",a[3]);
What do the following declaration signify? void *cmp();
If you don't initialize a static array, what will be the elements...
When we declare an array
The default return type of main() is 
The C statements printf (" The value= %x",62); will print
What is the similarity between a structure, union and enumeration?
Choose the odd one out
In the passage of text, individual words and punctuation marks are...
The file stdin has to be explicitly opened before it can be used
When the following piece of code is executed, what output will be...
Which of the following are not valid variable names in C?
The exit() function causes an exit from a function
Which option is used to print question mark
How many times is a do while loop guaranteed to loop
Choose the Correct one: p=5/2
Alert!

Advertisement