What will be printed?
char str[] = "Hello";
printf("%c", *(str+2));
How many times will the following loop execute?
int arr[5]; for(int i=0; i<5; i++) arr[i]=0;
What is the difference between arr[5] and *arr when arr is an array?
Which statement about 2D arrays in C is correct?
What is the output?
char str[6] = {'H','e','l','l','o'};
printf("%s", str);
Advertisement
Consider a 3D array: int arr[2][3][4]. How many elements total?
What happens with this code?
char *ptr;
char str[] = "Programming";
ptr = str;
ptr[2] = 'X';
What will the following code print?
int arr[3] = {10, 20, 30};
int *p = arr;
printf("%d %d", *p++, *++p);
How should dynamic 1D array of strings be declared for 5 strings of length 20?
What is the most efficient way to copy one array to another in C?
In C, when you declare an array like int arr[10], what does the array name 'arr' represent?
What is the size of the string 'Hello' when stored in a character array with null terminator?
Which of the following correctly initializes a 2D array of integers?
In the declaration char *str[5], what does the array represent?
What will be the result of accessing arr[10] when arr is declared as int arr[5]?
What is the difference between char str[20] and char *str in C?
How many elements can be stored in a 2D array declared as int matrix[4][5]?
What does strcpy(dest, src) do, and what is its main risk?
In a string comparison, strcmp('Apple', 'apple') returns:
What is the memory layout of a 2D array int arr[3][4] in C?