Advanced Computer Programming

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: 738 | Questions: 25
Please wait...
Question 1 / 25
0 %
0/100
Score 0/100
1.
Choose correct statement about Functions in C Language.

Explanation

The correct answer is "All of these". This means that all of the statements provided are correct about Functions in C Language. A function is a group of C statements that can be reused multiple times. Every function has a return type, and every function may or may not return a value.

Submit
Please wait...
About This Quiz
Advanced Computer Programming - Quiz

This advanced quiz in C programming tests knowledge on array operations, pointer basics, and error handling in code. It's designed to challenge and enhance the programming skills of... see morestudents and professionals alike, focusing on practical application and understanding of C language constructs. see less

2.
What is the need for C arrays.?

Explanation

The need for C arrays is to avoid creating multiple separate variables and getting confused while using them. With a single array variable, all elements of the array can be easily accessed. This improves code maintainability for programmers and maintainers. Therefore, the correct answer is "All the above."

Submit
3. An array Index starts with.?

Explanation

The correct answer is 0. In most programming languages, arrays are zero-indexed, meaning that the first element of an array has an index of 0. This means that if we have an array with n elements, the indices will range from 0 to n-1.

Submit
4.
What is the output of C program with arrays.? int main() {     int ary(3)=[20,30,40];     printf("%d", a(1)); }

Explanation

The given C program has a compiler error. The correct way to declare and initialize an array in C is by using square brackets [], not parentheses (). Therefore, the line "int ary(3)=[20,30,40];" should be changed to "int ary[3]={20,30,40};".

Submit
5.
Array of Arrays is also called.?

Explanation

An array of arrays is also known as a multi-dimensional array. This type of array allows for the organization of data in multiple dimensions, such as rows and columns. Each element in a multi-dimensional array can be accessed using multiple indices. This type of array is commonly used in programming languages to represent matrices or tables of data.

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

Explanation

The correct answer is "main()". In C programming, every program should contain a main() function. This function is the entry point of the program and is executed first when the program is run. It is mandatory to have a main() function in every C program.

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 C does not support multiple return values. If a function needs to return multiple values, it can use pointers or structures to achieve that.

Submit
8.
What is the output of C program with arrays.? int main() {    char grade={'A','B','C'};    printf("%c", grade[0]); }

Explanation

The given C program will result in a compiler error. This is because the array "grade" is declared as a character array but it is initialized with multiple characters instead of a string. In C, a string should be enclosed in double quotes. Therefore, the correct way to initialize the array would be: char grade[] = "ABC";

Submit
9.
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 array, the index starts from 0 for both rows and columns. Therefore, to access the element in the 3rd row and 2nd column, the index would be ary[2][1]. So, the correct answer is "All of these" as all the statements mentioned in the options are true about a multidimensional array in C Language.

Submit
10.
What is the output of C Program.? int main() {     int a[];     a[4] = {1,2,3,4};     printf("%d", a[0]); }

Explanation

The given code will result in a compiler error. This is because the array "a" is declared without a size, which is not allowed in C. The size of the array needs to be specified when declaring it.

Submit
11.
What are types of Functions in C Language.?

Explanation

The correct answer is "Both Library and User Defined". In C language, there are two types of functions - library functions and user-defined functions. Library functions are built-in functions provided by the C programming language and are stored in libraries. These functions can be directly used in a program without the need for any additional code. User-defined functions, on the other hand, are created by the programmer to perform specific tasks. These functions are defined and implemented by the programmer and can be reused multiple times in the program.

Submit
12.
Choose correct C while loop syntax.

Explanation

The correct answer is "while(condition) { //statements }" because this is the standard syntax for a while loop in C. The loop will continue executing as long as the condition is true, and the statements inside the loop will be executed repeatedly until the condition becomes false.

Submit
13.
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
14.
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 it is where the execution of the program begins. Without the main function, the program cannot be executed. Therefore, the minimum number of functions required in a C program is 1.

Submit
15.
What is the dimension of the below C Array.? int ary[]={1,3,5,7};

Explanation

The dimension of the given C array is 4. This is because the array "ary" contains 4 elements: 1, 3, 5, and 7.

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

Explanation

A function which calls itself is called a recursive function.

Submit
17.
What do you call this C Function calling itself.? int funny2() {     funny2(num); }

Explanation

The given C function is calling itself, which is known as recursion. Recursion is a process in which a function calls itself as a subroutine. Therefore, the correct answer is "Recursive Function".

Submit
18.
Choose a non Library C function below.

Explanation

The function printf2() is not a standard C library function. It is not included in the standard C library and is not recognized by the compiler. Therefore, it is a non-library C function.

Submit
19.
Difference between C Arrays, ary[10] and cry[10][10] is.?

Explanation

The correct answer is that ary[10] is a single dimensional array and cry[10][10] is a multidimensional array. This is because ary[10] is declared as a one-dimensional array with a size of 10, while cry[10][10] is declared as a two-dimensional array with dimensions of 10 by 10.

Submit
20. What is the output of C Program.? int main() {     int a[] = {1,2,3,4};     int b[4] = {5,6,7,8};     printf("%d,%d", a[0], b[0]); }

Explanation

The output of the given C program is "1,5". This is because the program declares two arrays, "a" and "b", and initializes them with different values. The printf statement then prints the first elements of both arrays, which are 1 from array "a" and 5 from array "b".

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

Explanation

Formal arguments are the arguments received by a function in C language. These arguments are declared in the function prototype and function definition. They act as placeholders for the actual arguments that are passed to the function when it is called.

Submit
22.
What is the function used to allocate memory to an array at run time without initializing array elements.?

Explanation

The function used to allocate memory to an array at run time without initializing array elements is malloc(). This function is used in C programming language to dynamically allocate memory for a specified number of bytes. It returns a pointer to the allocated memory, which can then be used to access and manipulate the array elements. Unlike calloc(), malloc() does not initialize the allocated memory to zero.

Submit
23.
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 program initializes an integer array 'a' with values 10, 12, and 14. It then enters a while loop that runs as long as the variable 'i' is less than 3. Inside the loop, it prints the value of 'i[a]', which is equivalent to 'a[i]'. Since 'i' starts at 0 and increments by 1 each iteration, the program prints the values of 'a' in order: 10, 12, 14. Therefore, the output of the program is "10, 12, 14".

Submit
24.
What is the output of C program with arrays.? int main() {     int a[3] = {20,30,40};     int b[3];     b=a;     printf("%d", b[0]); }

Explanation

The given program will result in a compiler error. This is because arrays cannot be assigned to each other directly in C. The line "b=a;" is trying to assign the array "a" to the array "b", which is not allowed.

Submit
25.
What is the output of C program.? int main() {     char grade[] = {'A','B','C'};     printf("GRADE=%d, ", *grade);     printf("GRADE=%d", grade[0]); }

Explanation

The program declares a character array called "grade" and initializes it with the values 'A', 'B', and 'C'. The first printf statement prints the value of the first element of the array using the dereference operator (*grade), which is the ASCII value of 'A', which is 65. The second printf statement prints the value of the first element of the array using the index notation (grade[0]), which again is the ASCII value of 'A', which is 65. Therefore, the output of the program is "GRADE=65, GRADE=65".

Submit
View My Results

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

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

  • Current Version
  • Mar 21, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Apr 21, 2020
    Quiz Created by
    Prof. Rakesh
Cancel
  • All
    All (25)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
Choose correct statement about Functions in C Language.
What is the need for C arrays.?
An array Index starts with.?
What is the output of C program with arrays.? ...
Array of Arrays is also called.?
Every C Program should contain which function.?
How many values can a C Function return at a time.?
What is the output of C program with arrays.? ...
What is a multidimensional array in C Language.?
What is the output of C Program.? ...
What are types of Functions in C Language.?
Choose correct C while loop syntax.
What is the dimension of the C array int ary[10][5].?
What is the minimum number of functions to be present in a C Program.?
What is the dimension of the below C Array.? int ary[]={1,3,5,7};
A function which calls itself is called a ___ function.
What do you call this C Function calling itself.? ...
Choose a non Library C function below.
Difference between C Arrays, ary[10] and cry[10][10] is.?
What is the output of C Program.? ...
Arguments received by a function in C language are called ___...
What is the function used to allocate memory to an array at run time...
What is the output of C program.? ...
What is the output of C program with arrays.? ...
What is the output of C program.? ...
Alert!

Advertisement