Pointers
- What are the elements present in the array of the following C code?
int num[4] = {10};
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
10, 0, 0, 0
- Comment on an array of the void data type.
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
You cannot have an array of void data type
- What will be the output of the following C code?
#include <stdio.h>
int main()
{
double *p = (double *)150;
p = p + 5;
printf("%u", p);
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: E
190
- What will be the output of the following C code?
#include <stdio.h>
int main()
{
int num[5] = {11, 21, 31, 41, 51};
int ptr[5];
ptr = num;
printf("%d\n", ptr[2]);
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
Compilation Error
main.c: In function ‘main’:
main.c:6:13: error: assignment to expression with array type
ptr = num;
- What will be the output of the following C code?
#include <stdio.h>
int main()
{
int array1[5] = {10, 20, 30, 40, 50};
int array2[5] = {11, 21, 31, 41, 51};
int R = &array2[3] - &array1[2];
printf("%d\n", R);
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
-7