Arrays And Strings — Part 1 MCQs with Explanations
Practice high-yield Programming & Software Development MCQs on Arrays And Strings — Part 1 with worked academic solutions for FPSC, PPSC, NTS, NITB, PTS.
Questions
40
Difficulty Level
Exam-Level
Target Exams
FPSC, PPSC, NTS...
Estimated Time
48 mins
Exam-Level FPSC PPSC NTS NITB PTS
Verified for Commission Syllabus • Oct 14, 2026
40
Verified Practice Questions
Interactive test mode with detailed academic worked solutions
Live Progress|0/40 answered
✓0 correct
✗0 wrong
0% score
🎉 Set complete! All 40 questions answered.
Question 1 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the highest index for an array with 10 elements in C?
Correct Answer: Option B — 9
Detailed Academic Explanation:
An array in C is indexed starting from 0. If an array has 10 elements, the first element will have an index of 0. The last element, therefore, will have an index of 9. Hence, the highest index for an array with 10 elements is 9.
💡Key Conceptual Anchor:Arrays And Strings
Question 2 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the size of an integer array declared as int arr[5] in bytes?
Correct Answer: Option B — 20
Detailed Academic Explanation:
The size of an integer array declared as int arr[5] in bytes depends on the size of an integer in the system. Typically, the size of an int is 4 bytes. Calculation: The array arr has 5 elements. Each int is 4 bytes. Total size = 5 * 4 = 20 bytes Therefore, the size of int arr[5] is 20 bytes.
💡Key Conceptual Anchor:Arrays And Strings
Question 3 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the maximum number of elements that can be stored in an array in C?
Correct Answer: Option A — Depends on memory
Detailed Academic Explanation:
The maximum number of elements that can be stored in an array in C depends on the available memory of the system in which the program is running. An array in C is a fixed-size data structure, which means that you need to specify the size (number of elements) of the array when you declare it. Here are a few key points: The size of an array should be a positive integer. The maximum value for the size of an array is limited by the amount of memory available in the system. The actual maximum size may vary from system to system. Attempting to allocate an array that is too large for the available memory can lead to program crashes or errors. So, in C, you can declare an array with a size that depends on the specific memory constraints of the computer where the program is executed. This is why the correct answer is Option A: Depends on memory . The other options specify fixed limits, which is not accurate for C arrays. Remember that it's essential to manage memory efficiently to avoid issues like memory exhaustion or segmentation faults when working with arrays in C.
💡Key Conceptual Anchor:Arrays And Strings
Question 4 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the output of printf("%d", sizeof("Hello")); in C?
Correct Answer: Option B — 6
Detailed Academic Explanation:
The printf("%d", sizeof("Hello")) statement in C is used to determine the size (in bytes) of the string literal "Hello" including the null terminator. In C, string literals are automatically null-terminated. The string "Hello" consists of 5 characters: 'H', 'e', 'l', 'l', 'o', and it also includes a null terminator ('\0') at the end to mark the end of the string. So, the total size of the string literal "Hello" is 6 bytes (5 characters + 1 null terminator). Therefore, the output of printf("%d", sizeof("Hello")) will be Option B: 6 because it's the size of the string in bytes, including the null terminator.
💡Key Conceptual Anchor:Arrays And Strings
Question 5 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the purpose of the fgets function in C?
Correct Answer: Option B — Read a string from the console
Detailed Academic Explanation:
The purpose of the fgets function in C is to read a string from the console . fgets reads a line of text from the specified input stream and stores it into the string pointed to by the provided pointer. This function is often used to read input from the user via the console. Therefore, fgets = read a string from the console .
💡Key Conceptual Anchor:Arrays And Strings
Question 6 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is right way to Initialize array?
Correct Answer: Option A — int num[6] = { 2, 4, 12, 5, 45, 5 }
Detailed Academic Explanation:
option (B), (C) and (D) are incorrect because array declaration syntax is wrong. Only square brackets([]) must be used for declaring an array.
💡Key Conceptual Anchor:Arrays And Strings
Question 7 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the program? #include<stdio.h> void main() { int a[5] = {5, 1, 15, 20, 25}; int i, j, m; i = ++a[1]; j = a[1]++; m = a[i++]; printf("%d, %d, %d", i, j, m); }
Correct Answer: Option A — 3, 2, 15
Detailed Academic Explanation:
>> int a[5] = {5, 1, 15, 20, 25}; The variable arr is declared as an integer array with a size of 5 and it is initialized to a[0] = 5, a[1] = 1, a[2] = 15, a[3] = 20, a[4] = 25. >> int i, j, m; The variable i, j, m are declared as an integer type. >> i = ++a[1]; becomes i = ++1; Hence i = 2 and a[1] = 2 >> j = a[1]++; becomes j = 2++; Hence j = 2 and a[1] = 3. >> m = a[i++]; becomes m = a[2]; Hence m = 15 and i is incremented by 1(i++ means 2++ so i=3) >> printf("%d, %d, %d", i, j, m); It prints the value of the variables i, j, m Hence the output of the program is 3, 2, 15.
💡Key Conceptual Anchor:Arrays And Strings
Question 8 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of following program code? #include <stdio.h> int main(void) { char p; char buf[10] = {1, 2, 3, 4, 5, 6, 9, 8}; p = (buf + 1)[5]; printf("%d", p); return 0; }
Correct Answer: Option C — 9
Detailed Academic Explanation:
x [ i ] is equivalent to *( x + i ) , so ( buf + 1 )[ 5 ] is *( buf + 1 + 5 ) , i.e. buf [ 6 ] .
💡Key Conceptual Anchor:Arrays And Strings
Question 9 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
An array elements are always stored in ________ memory locations.
Correct Answer: Option A — Sequential
Detailed Academic Explanation:
In C programming, an array is a data structure that stores multiple elements of the same type. The key feature of an array is that its elements are stored in sequential memory locations . Here’s a detailed explanation: 1. Memory Contiguity: When an array is declared, the compiler allocates a block of memory large enough to hold all the elements. These elements are stored one after the other in contiguous memory addresses. For example, if you declare an array of 5 integers, the memory allocated for the array will be continuous, and each integer will be placed next to the previous one. 2. Accessing Elements: Due to the sequential storage, the array elements can be accessed easily using their index. The index represents the position of the element in the array, and since the memory is sequential, calculating the memory address of any element becomes straightforward. The address of any element in the array can be calculated as: Address=Base Address+(Index×Size of each element) Here, the Base Address is the memory address of the first element in the array. 3. Efficiency: The sequential nature of arrays makes accessing and iterating through elements efficient. Since the elements are stored contiguously, the CPU can access them quickly by simply moving through the memory locations. 4. Contrast with Other Storage Methods: Unlike arrays, other data structures like linked lists store elements in non-contiguous memory locations. This requires pointers to link elements together, which can lead to more complex memory management and slower access times compared to arrays. 5. Implications for Multidimensional Arrays: In multidimensional arrays (e.g., 2D arrays), the elements are still stored sequentially in memory, typically in row-major order. This means the elements of the first row are stored first, followed by the elements of the second row, and so on. In summary, the sequential storage of array elements is a fundamental characteristic of arrays in C, contributing to their simplicity and efficiency in memory usage and access.
💡Key Conceptual Anchor:Arrays And Strings
Question 10 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Let x be an array. Which of the following operations are illegal? I. ++x II. x+1 III. x++ IV. x*2
Correct Answer: Option D — I, III and IV
Detailed Academic Explanation:
int x[10]; * x will store the base address of array. * Statement I, III and IV is invalid. Statement I and III : ++x and x++ are throwing en error while compile (lvalue required as increment operand ) Since, x is storing in the address of the array which is static value which cannot be change by the operand. Statement IV : x*2 is also throw an error while compile (invalid operands to binary * (have 'int *' and 'int') ) Statement II : x+1 is throw a warning: assignment makes integer from pointer without a cast [enabled by default]
💡Key Conceptual Anchor:Arrays And Strings
Question 11 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Size of the array need not be specified, when
Correct Answer: Option A — Initialization is a part of definition
Detailed Academic Explanation:
In C programming, the size of the array does not need to be specified when initialization is a part of definition . Initialization during Definition: When an array is defined and initialized at the same time, the size of the array can be omitted. The size is automatically determined by the number of elements provided in the initialization. For example: int arr[] = {1, 2, 3, 4, 5}; // Size is determined by the number of elements Declaration: When declaring an array without initializing it, the size must be specified if the array is not initialized. For example: int arr[5]; // Size must be specified Formal Parameter: In function prototypes or definitions where an array is used as a formal parameter, the size does not need to be specified. For example: void function(int arr[]); // Size not required All of These: This option is incorrect because the size must be specified in cases other than initialization during definition. Therefore, the correct answer is Option A: Initialization is a part of definition .
💡Key Conceptual Anchor:Arrays And Strings
Question 12 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Consider the following type definition. typedef char x[10]; x myArray[5]; What will sizeof(myArray) be ? (Assume one character occupies 1 byte)
Correct Answer: Option C — 50
Detailed Academic Explanation:
In this case, the type definition typedef char x[10]; creates a new type x , which is an array of 10 characters. Then, an array of 5 elements of type x is declared as x myArray[5]; . To calculate the size of myArray , you can multiply the size of one element ( sizeof(x) ) by the number of elements (5): sizeof(myArray) = sizeof(x) * 5 Since each element x is an array of 10 characters, and assuming each character occupies 1 byte, the size of x is 10 bytes. Therefore: sizeof(myArray) = 10 bytes * 5 = 50 bytes So, sizeof(myArray) will be 50 bytes.
💡Key Conceptual Anchor:Arrays And Strings
Question 13 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be printed after execution of the following code? void main() { int arr[10] = {1,2,3,4,5}; printf("%d", arr[5]); }
Correct Answer: Option D — 0
Detailed Academic Explanation:
When an array is partially initialized at the time of declaration then the remaining elements of the array is initialized to 0 by default.
💡Key Conceptual Anchor:Arrays And Strings
Question 14 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following program? void main() { char str1[] = "abcd"; char str2[] = "abcd"; if(str1==str2) printf("Equal"); else printf("Unequal"); }
Correct Answer: Option B — Unequal
Detailed Academic Explanation:
Strings are compared using strcmp () function defined under string.h header file.
💡Key Conceptual Anchor:Arrays And Strings
Question 15 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following code? void main() { int a[10]; printf("%d %d", a[-1], a[12]); }
Correct Answer: Option D — Garbage vlaue Garbage Value
Detailed Academic Explanation:
In c compiler does not check array with its bounds, value at the computed location is displayed.
💡Key Conceptual Anchor:Arrays And Strings
Question 16 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What does the following declaration mean? int ( *ptr ) [ 10 ] ;
Correct Answer: Option B — ptr is a pointer to an array of 10 integers
Detailed Academic Explanation:
The declaration int (*ptr)[10]; means that ptr is a pointer to an array of 10 integers. Here's the breakdown: int specifies the type of elements in the array (integers). (*ptr) indicates that ptr is a pointer. [10] specifies that the pointer points to an array of 10 integers. Thus, ptr is not an array of pointers, nor an array of integers, but a pointer to an array of integers with a size of 10.
💡Key Conceptual Anchor:Arrays And Strings
Question 17 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the program if the array begins at 65472 and each integer occupies 2 bytes? #include<stdio.h> void main() { int a[3][4] = {1, 2, 3, 4, 4, 3, 2, 1, 7, 8, 9, 0}; printf("%u, %u", a+1, &a+1); }
Correct Answer: Option C — 65480, 65496
Detailed Academic Explanation:
>> int a[3][4] = {1, 2, 3, 4, 4, 3, 2, 1, 7, 8, 9, 0}; The array a[3][4] is declared as an integer array having the 3 rows and 4 colums dimensions. >> printf ("%u, %u\n", a+1, &a+1); The base address(also the address of the first element) of array is 65472. For a two-dimensional array like a reference to array has type "pointer to array of 4 ints". Therefore, a+1 is pointing to the memory location of first element of the second row in array a. Hence 65472 + (4 ints * 2 bytes) = 65480 Then, &a has type "pointer to array of 3 arrays of 4 ints", totally 12 ints. Therefore, &a+1 denotes "12 ints * 2 bytes * 1 = 24 bytes". Hence, begining address 65472 + 24 = 65496. So, &a+1 = 65496 Hence the output of
💡Key Conceptual Anchor:Arrays And Strings
Question 18 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the program? #include<stdio.h> int main() { int arr[1] = {10}; printf("%d", 0[arr]); return 0; }
Correct Answer: Option C — 10
Detailed Academic Explanation:
>> int arr[1]={10}; The variable arr[1] is declared as an integer array with size '2' i.e. arr[0] and arr[1] and it's first element is initialized to value '10'(means arr[0]=10) and arr[1] = garbage value or zero >> printf ("%d", 0[arr]); It prints the first element value of the variable arr. Hence the output of the program is 10.
💡Key Conceptual Anchor:Arrays And Strings
Question 19 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the program if the array begins at address 65486? #include<stdio.h> void main() { int arr[] = {12, 14, 15, 23, 45}; printf("%u, %u", arr, &arr); }
Correct Answer: Option D — 65486, 65486
Detailed Academic Explanation:
>> int arr[] = {12, 14, 15, 23, 45}; The variable arr is declared as an integer array and initialized. >> printf ("%u, %u", arr, &arr); Here, The base address of the array is 65486. => arr, &arr is pointing to the base address of the array arr. Hence the output of the program is 65486, 65486.
💡Key Conceptual Anchor:Arrays And Strings
Question 20 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the program? #include<stdio.h> void main() { float arr[] = {12.4, 2.3, 4.5, 6.7}; printf("%d", sizeof(arr)/sizeof(arr[0])); }
Correct Answer: Option B — 4
Detailed Academic Explanation:
The sizeof function return the given variable. Example: float a=10; sizeof(a) is 4 bytes >> float arr[] = {12.4, 2.3, 4.5, 6.7}; The variable arr is declared as an floating point array and it is initialized with the values. >> printf ("%d", sizeof(arr)/sizeof(arr[0])); The variable arr has 4 elements. The size of the float variable is 4 bytes. Hence 4 elements x 4 bytes = 16 bytes sizeof(arr[0]) is 4 bytes Hence 16/4 is 4 bytes Hence the output of the program is '4'.
💡Key Conceptual Anchor:Arrays And Strings
Question 21 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following is correct way to define the function fun() in the below program? #include<stdio.h> void main() { int a[3][4]; fun(a); }
Correct Answer: Option A — void fun(int p[][4]){}
Detailed Academic Explanation:
void fun(int p[][4]){ } is the correct way to write the function fun(). while the others are considered only the function fun() is called by using call by reference.
💡Key Conceptual Anchor:Arrays And Strings
Question 22 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following statements are correct about the program below? #include<stdio.h> void main() { int size, i; scanf("%d", &size); int arr[size]; for(i=1; i<=size; i++) { scanf("%d", arr[i]); printf("%d", arr[i]); } }
Correct Answer: Option A — The code is erroneous since the statement declaring array is invalid.
Detailed Academic Explanation:
The statement int arr[size]; produces an error, because we cannot initialize the size of array dynamically. Constant expression is required here. Example: int arr[10]; One more point is there, that is, usually declaration is not allowed after calling any function in a current block of code. In the given program the declaration int arr[10]; is placed after a function call scanf().
💡Key Conceptual Anchor:Arrays And Strings
Question 23 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following statements are correct about an array? 1. The array int num[26]; can store 26 elements. 2. The expression num[1] designates the very first element in the array. 3. It is necessary to initialize the array at the time of declaration. 4. The declaration num[SIZE] is allowed if SIZE is a macro.
Correct Answer: Option B — 1, 4
Detailed Academic Explanation:
1. The array int num[26]; can store 26 elements. This statement is true. 2. The expression num[1] designates the very first element in the array. This statement is false, because it designates the second element of the array. 3. It is necessary to initialize the array at the time of declaration. This statement is false. 4. The declaration num[SIZE] is allowed if SIZE is a macro. This statement is true, because the MACRO just replaces the symbol SIZE with given value. Hence the statements '1' and '4' are correct statements.
💡Key Conceptual Anchor:Arrays And Strings
Question 24 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
If the two strings are identical, then strcmp () function returns
Correct Answer: Option B — 0
Detailed Academic Explanation:
Declaration: strcmp(const char *s1, const char*s2); The strcmp return an int value that is if s1 < s2 returns a value < 0 if s1 == s2 returns 0 if s1 > s2 returns a value > 0
💡Key Conceptual Anchor:Arrays And Strings
Question 25 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
The library function used to find the last occurrence of a character in a string is
Correct Answer: Option D — strrchr()
Detailed Academic Explanation:
Declaration: char * strrchr ( const char * s, int c); It scans a string s in the reverse direction, looking for a specific character c.
💡Key Conceptual Anchor:Arrays And Strings
Question 26 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following function is used to find the first occurrence of a given string in another string?
Correct Answer: Option C — strstr()
Detailed Academic Explanation:
The function strstr () Finds the first occurrence of a substring in another string Declaration: char * strstr ( const char * s1, const char * s2 ) ; Return Value: On success, strstr returns a pointer to the element in s1 where s2 begins (points to s2 in s1). On error (if s2 does not occur in s1), strstr returns null.
💡Key Conceptual Anchor:Arrays And Strings
Question 27 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following function is more appropriate for reading in a multi-word string?
Correct Answer: Option B — gets()
Detailed Academic Explanation:
gets () ; collects a string of characters terminated by a new line from the standard input stream stdin
💡Key Conceptual Anchor:Arrays And Strings
Question 28 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the program? #include<stdio.h> #include<string.h> void main() { char str1[20] = "Hello", str2[20] = " World"; printf("%s", strcpy(str2, strcat(str1, str2))); }
Correct Answer: Option A — Hello World
Detailed Academic Explanation:
>> char str1[20] = "Hello", str2[20] = " World"; The variable str1 and str2 is declared as an array of characters and initialized with value "Hello" and " World" respectively. >> printf ( " %s n ", strcpy ( str2, strcat ( str1, str2 ))) ; => strcat (str1, str2) it append the string str2 to str1. The result will be stored in str1. Therefore str1 contains "Hello World". => strcpy (str2, "Hello World") it copies the "Hello World" to the variable str2. Hence it prints "Hello World".
💡Key Conceptual Anchor:Arrays And Strings
Question 29 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the program? #include<stdio.h> void main() { printf(5+"Good Morningn"); }
Correct Answer: Option D — Morning
Detailed Academic Explanation:
printf(5+"Good Morning\n"); It skips the 5 characters and prints the given string. Hence the output is "Morning".
💡Key Conceptual Anchor:Arrays And Strings
Question 30 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the program? #include<stdio.h> #include<string.h> void main() { char str[] = "Exam\0Veda"; printf("%s", str); }
Correct Answer: Option A — Exam
Detailed Academic Explanation:
A string is a collection of characters terminated by '\0'. >> char str[] = "Exam\0\Veda\0"; The variable str is declared as an array of characters and initialized with value "Exam". >> printf ("%s", str); It prints the value of the str. The output of the program is "Exam".
💡Key Conceptual Anchor:Arrays And Strings
Question 31 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following correctly accesses the seventh element stored in arr, an array with 100 elements?
Correct Answer: Option A — arr[6]
Detailed Academic Explanation:
Array index always starts with 0.
💡Key Conceptual Anchor:Arrays And Strings
Question 32 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the return value of the following statement if it is placed in C program? strcmp("ABC", "ABC");
Correct Answer: Option D — 0
Detailed Academic Explanation:
strcmp(s1, s2); returns int as follows: == 0, when s1 == s2 < 0, when s1 < s2 > 0, when s1 > s2
💡Key Conceptual Anchor:Arrays And Strings
Question 33 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
int a [ 5 ] = { 1,2,3 } What is the value of a [ 4 ] ?
Correct Answer: Option D — 0
Detailed Academic Explanation:
In the fourth location of an array it contains 0 since default initialization will take place.
💡Key Conceptual Anchor:Arrays And Strings
Question 34 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the correct output of the following program? #include<string.h> void main() { char str[] = "C EXAMINATION", rev[17]; int i = strlen(str), j=0; for( ; i>=0; rev[j++] = str[i--]) rev[j] = str[j] ; puts(rev); }
Correct Answer: Option D — No output at all.
Detailed Academic Explanation:
As i is with the length of string and hence in array rev the contents are copied as "\0 NOITANIMAXE C". But while displaying those contents with puts function it stops because of the first character '\0' and hence no output.
💡Key Conceptual Anchor:Arrays And Strings
Question 35 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
String concatenation means -
Correct Answer: Option A — Combining two strings.
Detailed Academic Explanation:
Concatenation means combining two strings together (appending the second at the end of first one).
💡Key Conceptual Anchor:Arrays And Strings
Question 36 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which keyword is used to declare a character array in C?
Correct Answer: Option D — char
Detailed Academic Explanation:
char is the correct answer to “Which keyword is used to declare a character array in C”. This question is standard in competitive examination syllabi for Arrays And Strings.
💡Key Conceptual Anchor:Arrays And Strings
Question 37 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which function is used to compare two strings in C?
Correct Answer: Option A — strcmp
Detailed Academic Explanation:
strcmp is the correct answer to “Which function is used to compare two strings in C”. This question is standard in competitive examination syllabi for Arrays And Strings.
💡Key Conceptual Anchor:Arrays And Strings
Question 38 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
How do you access the first element of an array arr in C?
Correct Answer: Option B — arr[0]
Detailed Academic Explanation:
arr[0] is the correct answer to “How do you access the first element of an array arr in C”. This question is standard in competitive examination syllabi for Arrays And Strings.
💡Key Conceptual Anchor:Arrays And Strings
Question 39 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which type of loop is commonly used to iterate through an array in C?
Correct Answer: Option C — for loop
Detailed Academic Explanation:
for loop is the correct answer to “Which type of loop is commonly used to iterate through an array in C”. This question is standard in competitive examination syllabi for Arrays And Strings.
💡Key Conceptual Anchor:Arrays And Strings
Question 40 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which function is used to find the length of a string in C?
Correct Answer: Option C — strlength
Detailed Academic Explanation:
strlength is the correct answer to “Which function is used to find the length of a string in C”. This question is standard in competitive examination syllabi for Arrays And Strings.
💡Key Conceptual Anchor:Arrays And Strings
✓Link copied to clipboard
Continue Your Practice
Advance Html — Part 1
Master the next curriculum module with 40 exam-standard MCQs.
💡Examiner's Advisory for Programming & Software Development
In competitive commission exams (FPSC, PPSC, KPPSC, SPSC, CSS, PMS), questions are frequently phrased with distractor options designed to catch rote learners. Whenever you answer an MCQ, read the Detailed Academic Explanation and Conceptual Anchor to understand why the remaining options are incorrect.