iGET

C Programming - MCQ Practice Questions

Practice free C Programming multiple-choice questions with detailed answers and explanations. Perfect for competitive exam preparation.

978 questions | 100% Free

Q.121Easy

What will be the output of strlen("Hello") in C?

Q.122Easy

Which of the following is NOT a valid string initialization?

Q.123Easy

What does the following code do? strcpy(dest, src);

Q.124Easy

Consider a 2D array declared as: int matrix[3][4]. How many elements does it have?

Q.125Easy

If an integer array arr[10] is declared globally in C, what will be the initial values of its elements?

Q.126Easy

In C, a string is internally represented as:

Q.127Easy

How much memory is allocated for char name[50] declaration?

Q.128Easy

What is the time complexity of accessing an element at index 5 in an array?

Q.129Easy

What does strlen() function return for the string "C2025"?

Q.130Easy

What will be the output of the following code? int arr[] = {1, 2, 3, 4, 5}; printf("%d", *(arr + 3));

Q.131Easy

Which of the following correctly declares a 2D array of strings?

Q.132Easy

What is the output of strlen("Hello") in C?

Q.133Easy

How many bytes are allocated by: int arr[10][20];?

Q.134Easy

What will be printed? char *str = "Hello"; printf("%c", str[1]);

Q.135Easy

Predict the output: int arr[3][3] = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}; printf("%d", arr[1][2]);

Q.136Easy

What is the output? int arr[] = {10, 20, 30, 40}; int *p = arr; printf("%d", p[2]);

Q.137Easy

What is the maximum size of a string that can be stored in char str[50]?

Q.138Easy

Which function is used to find the length of a string in C?

Q.139Easy

How many bytes does a 2D array int arr[3][4] occupy in memory?

Q.140Easy

How many times will the following loop execute? int arr[5]; for(int i=0; i<5; i++) arr[i]=0;