Programming For Problem Solving

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 Prof. Rakesh
P
Prof. Rakesh
Community Contributor
Quizzes Created: 4 | Total Attempts: 2,238
| Attempts: 832 | Questions: 30
Please wait...
Question 1 / 30
0 %
0/100
Score 0/100
1.
Array of Arrays is also called.?

Explanation

An array of arrays is also called a multi-dimensional array because it represents data in multiple dimensions. In a multi-dimensional array, each element can be accessed using multiple indices, allowing for more complex data structures to be represented.

Submit
Please wait...
About This Quiz
Programming For Problem Solving - Quiz

This quiz titled 'Programming for Problem Solving' assesses knowledge in C programming, focusing on understanding functions, recursion, and program structure. It is designed for learners to validate their coding skills and grasp of fundamental programming concepts.

Tell us your name to personalize your report, certificate & get on the leaderboard!
2.
Array of Arrays is also called.?

Explanation

An array of arrays is also known as a multi-dimensional array. This is because it is an array that contains other arrays as its elements, creating a structure with multiple dimensions. Each element in the outer array is itself an array, allowing for the storage and manipulation of data in a multi-dimensional manner.

Submit
3.
Every C Program should contain which function.?

Explanation

The main() function is the entry point of a C program. It is required in every C program and serves as the starting point of program execution. The main() function is where the program begins and from where other functions can be called. It is responsible for executing the statements inside its body and returning an integer value to the operating system.

Submit
4. What is the minimum number of functions to be present in a C Program.?

Explanation

A minimum of one function must be present in a C program because every C program must have a main() function. The main() function serves as the entry point of the program and is required for the program to execute. Without a main() function, the program would not have any instructions to execute and would not be able to run.

Submit
5.
What is an array Base Address in C language.?

Explanation

The correct answer is "All of these." The base address of an array in C language refers to the address of the 0th index element. It can be accessed using either the notation &b[0] or simply b. Therefore, all of the given options are correct explanations of the array base address in C language.

Submit
6.
What is the C keyword that must be used to achieve expected result using Recursion.?

Explanation

The keyword "return" must be used to achieve the expected result using recursion. This is because recursion involves a function calling itself, and the result of each recursive call needs to be returned back to the previous call in order to continue the recursion. The "return" keyword allows the function to return a value back to the caller.

Submit
7.
How many values can a C Function return at a time.?

Explanation

A C function can only return one value at a time. This is because the return statement in C can only return a single value. If multiple values need to be returned, they can be packed into a data structure such as an array or a struct, and then the function can return that data structure.

Submit
8.
Choose a correct statement about Recursive Function in C language.

Explanation

The statement "All of these" is the correct answer because it encompasses all the other options. Each recursion creates new variables at different memory locations, there is no limit on the number of recursive calls, and pointers can also be used with recursion but with difficulty. Therefore, all of these statements are correct.

Submit
9.
What are the Types of Arrays.?

Explanation

The correct answer is "All of these". This is because the types of arrays can include int, long, float, double, struct, enum, and char. Therefore, all of these options are correct.

Submit
10.
What is an Array in C language.?

Explanation

An array in C language is a data structure that allows storing a group of elements of the same data type. It can contain more than one element, and the elements are stored in memory in continuous or contiguous locations. Therefore, all of the given options are correct explanations of what an array is in C language.

Submit
11.
What is the minimum number of functions to be present in a C Program.?

Explanation

A C program must have at least one function, which is the main function. The main function is the entry point of the program and is required for the program to execute. Without the main function, the program will not be able to run. Therefore, the minimum number of functions required in a C program is 1.

Submit
12.
What is a multidimensional array in C Language.?

Explanation

A multidimensional array in C language is an array of arrays. It is like a matrix or table with rows and columns. To access a specific element in the multidimensional array, we use the syntax ary[row][column], where the index starts from 0 for both rows and columns. Therefore, to access the 3rd row and 2nd element, we would use ary[2][1]. So, the correct answer is "All of these" because all the statements mentioned are true regarding multidimensional arrays in C language.

Submit
13.
A function which calls itself is called a ___ function.

Explanation

A function which calls itself is called a recursive function. This type of function is used to solve problems that can be broken down into smaller subproblems of the same type. The function calls itself repeatedly until a base case is reached, which stops the recursion. This allows the function to solve the problem by solving the smaller subproblems and combining their solutions.

Submit
14.
What is the dimension of the C array int ary[10][5].?

Explanation

The dimension of the C array int ary[10][5] is 2. This is because the array has two dimensions, with the first dimension being 10 and the second dimension being 5. The first dimension represents the number of rows in the array, while the second dimension represents the number of columns. In this case, the array has 10 rows and 5 columns, making it a two-dimensional array.

Submit
15.
What is the dimension of the C array int ary[10][5].?

Explanation

The dimension of the C array int ary[10][5] is 2. This is because the array has two dimensions: the first dimension has a size of 10 and the second dimension has a size of 5.

Submit
16.
What is the output of C Program with pointers.? int main() {     int a = 4;     int *p;     p=&a;     while(*p > 0)     {         printf("%d ", *p);         (*p)--;     }     return 0; }

Explanation

The given C program initializes an integer variable 'a' with the value 4 and declares a pointer variable 'p'. The pointer 'p' is then assigned the address of 'a'.

The while loop condition checks if the value pointed to by 'p' is greater than 0. Inside the loop, the value pointed to by 'p' is printed using printf and then decremented by 1. This process continues until the value pointed to by 'p' becomes 0.

Therefore, the output of the program is "4 3 2 1", as the value of 'a' is decremented by 1 in each iteration of the loop.

Submit
17.
What is the output of C Program with functions.? static void show(); int main() {     printf("GROW ");     show();     return 0; } static void show() {     printf("MORE"); }

Explanation

The program first prints "GROW" in the main function. Then, it calls the show() function, which prints "MORE". Therefore, the output of the program will be "GROW MORE".

Submit
18.
An entire array is always passed by ___ to a called function.

Explanation

In call by reference, the memory address of the entire array is passed to the called function. This means that any changes made to the array within the called function will also affect the original array in the calling function.

Submit
19.
Arguments received by a function in C language are called ___ arguments.

Explanation

Formal arguments are the arguments received by a function in C language. They are also known as parameters. These arguments are defined in the function prototype and are used to pass values to the function when it is called. The function then uses these values to perform its operations.

Submit
20.
What is the output of C program.? int main() {     int a[3] = {10,12,14};     int i=0;     while(i<3)     {         printf("%d ", i[a]);         i++;     } }

Explanation

The output of the program is "10 12 14" because the expression "i[a]" is equivalent to "a[i]". In each iteration of the while loop, the value of "i" is used as an index to access the corresponding element of the array "a". So, in the first iteration, "i" is 0 and "a[0]" is 10, in the second iteration, "i" is 1 and "a[1]" is 12, and in the third iteration, "i" is 2 and "a[2]" is 14. Therefore, the program prints "10 12 14" as the output.

Submit
21.
Choose a non Library C function below.

Explanation

The functions printf(), scanf(), and fprintf() are all standard C library functions. However, printf2() is not a standard C library function.

Submit
22.
What is the maximum number of statements that can present in a C function.?

Explanation

not-available-via-ai

Submit
23.
What is the default return value of a C function if not specified explicitly.?

Explanation

The default return value of a C function, if not specified explicitly, is 1.

Submit
24.
What is the output of C Program with functions.? int show(); void main() {     int a;     printf("PISTA COUNT=");     a=show();     printf("%d", a); } int show() {     return 10; }

Explanation

The correct answer is "PISTA COUNT=10". In the given code, the function "show()" is defined and it returns the value 10. In the main function, the variable "a" is assigned the value returned by the "show()" function, which is 10. Then, the printf statement prints the value of "a", which is 10, after the string "PISTA COUNT=". Therefore, the output of the program is "PISTA COUNT=10".

Submit
25.
If an integer array pointer is incremented, how many bytes will be skipped to reach next element location.?

Explanation

When an integer array pointer is incremented, it skips the number of bytes equal to the size of an integer data type. In most systems, an integer data type occupies 4 bytes of memory. Therefore, when the pointer is incremented, it will skip 4 bytes to reach the next element location in the array.

Submit
26.
How many functions are required to create a recursive functionality.?

Explanation

To create a recursive functionality, only one function is required. A recursive function is a function that calls itself within its own definition. This allows the function to repeat a specific set of instructions until a certain condition is met. Therefore, only one function is needed to create this recursive behavior.

Submit
27.
What is the output of C Program with functions.? void show(); int main() {     show();     printf("ARGENTINA ");     return 0; } void show() {     printf("AFRICA "); }

Explanation

The correct answer is "AFRICA, ARGENTINA". In this program, the function show() is called before the printf() statement in the main function. So, when the program is executed, the show() function is called first and it prints "AFRICA". Then, the printf() statement in the main function prints "ARGENTINA". Therefore, the output of the program is "AFRICA, ARGENTINA".

Submit
28.
What is the output of C Program with arrays.? int main() {     static int ary[] = {1, 3, 5};     printf("%d %d", ary[-1], ary[5]);     return 0; }

Explanation

The program declares a static integer array "ary" with 3 elements: 1, 3, and 5. In the printf statement, it tries to access the elements at index -1 and index 5 of the array. However, both of these indices are out of bounds of the array. In C, accessing elements outside the bounds of an array results in undefined behavior. In this case, it happens to print the values 0 and 0, but this behavior is not guaranteed and may vary depending on the compiler and system.

Submit
29.
What is the output of C Program with functions.? int main() {     int a=20;     printf("INDIA ");     return 1;     printf("CORONA");     return 1; }

Explanation

The correct answer is "INDIA" because the program only executes the printf statement before the first return statement. The printf statement "INDIA" is executed and printed to the console, and then the program exits with a return value of 1. The printf statement "CORONA" is never executed.

Submit
30.
What is the need for C arrays.?

Explanation

C arrays are used to store multiple values of the same data type in a single variable. By using arrays, we can avoid the need to create multiple separate variables, which can lead to confusion while using them. Instead, we can access all elements of the array easily using a single array variable. This improves code maintainability for programmers and maintainers as it reduces the number of variables and simplifies the code structure. Therefore, the need for C arrays is to simplify variable management and improve code maintainability.

Submit
View My Results

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

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

  • Current Version
  • Mar 22, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Apr 29, 2020
    Quiz Created by
    Prof. Rakesh
Cancel
  • All
    All (30)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
Array of Arrays is also called.?
Array of Arrays is also called.?
Every C Program should contain which function.?
What is the minimum number of functions to be present in a C Program.?
What is an array Base Address in C language.?
What is the C keyword that must be used to achieve expected result...
How many values can a C Function return at a time.?
Choose a correct statement about Recursive Function in C language.
What are the Types of Arrays.?
What is an Array in C language.?
What is the minimum number of functions to be present in a C Program.?
What is a multidimensional array in C Language.?
A function which calls itself is called a ___ function.
What is the dimension of the C array int ary[10][5].?
What is the dimension of the C array int ary[10][5].?
What is the output of C Program with pointers.? ...
What is the output of C Program with functions.? ...
An entire array is always passed by ___ to a called function.
Arguments received by a function in C language are called ___...
What is the output of C program.? ...
Choose a non Library C function below.
What is the maximum number of statements that can present in a C...
What is the default return value of a C function if not specified...
What is the output of C Program with functions.? ...
If an integer array pointer is incremented, how many bytes will...
How many functions are required to create a recursive functionality.?
What is the output of C Program with functions.?...
What is the output of C Program with arrays.? ...
What is the output of C Program with functions.? ...
What is the need for C arrays.?
Alert!

Advertisement