C Programming Pointers Online Test, C Programming Question & Answers
C Programming Pointers Online Test
Finish Quiz
0 of 30 questions completed
Questions:
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
Information
C Programming Pointers Online Test. C Programming Question and Answers in English. C Programming Pointers Online mock test paper is free for all students and Very Helpful for Exam Preparation. C Programming Pointers Online Quiz. C Programming Online Mock test for Pointers Topic. Here we are providing C Programming Pointers Online Test Series in English. Check C Programming Mock Test Series 2019-2019.
This paper has 30 questions.
Time allowed is 30 minutes.
The C Programming online Mock Test Exam is Very helpful for all students. Now Scroll down below n click on “Start Quiz” or “Start Test” and Test yourself.
You have already completed the quiz before. Hence you can not start it again.
Quiz is loading...
You must sign in or sign up to start the quiz.
You have to finish following quiz, to start this quiz:
Results
0 of 30 questions answered correctly
Your time:
Time has elapsed
You have reached 0 of 0 points, (0)
Average score |
|
Your score |
|
Categories
- Not categorized 0%
Pos. | Name | Entered on | Points | Result |
---|---|---|---|---|
Table is loading | ||||
No data available | ||||
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- Answered
- Review
-
Question 1 of 30
1. Question
What is (void*)0?
Correct
Incorrect
-
Question 2 of 30
2. Question
Can you combine the following two statements into one?
char *p; p = (char*) malloc(100);
Correct
Incorrect
-
Question 3 of 30
3. Question
In which header file is the NULL macro defined?
Correct
The macro “NULL” is defined in locale.h, stddef.h, stdio.h, stdlib.h, string.h, time.h, and wchar.h.
Incorrect
The macro “NULL” is defined in locale.h, stddef.h, stdio.h, stdlib.h, string.h, time.h, and wchar.h.
-
Question 4 of 30
4. Question
How many bytes are occupied by near, far and huge pointers (DOS)?
Correct
near=2, far=4 and huge=4 pointers exist only under DOS. Under windows and Linux every pointers is 4 bytes long.Incorrect
near=2, far=4 and huge=4 pointers exist only under DOS. Under windows and Linux every pointers is 4 bytes long. -
Question 5 of 30
5. Question
If a variable is a pointer to a structure, then which of the following operator is used to access data members of the structure through the pointer variable?
Correct
Incorrect
-
Question 6 of 30
6. Question
What would be the equivalent pointer expression for referring the array element a[i][j][k][l]
Correct
Incorrect
-
Question 7 of 30
7. Question
A pointer is
Correct
Incorrect
-
Question 8 of 30
8. Question
The operator used to get value at address stored in a pointer variable is
Correct
Incorrect
-
Question 9 of 30
9. Question
What will be the output of the program ?
#include
Correct
Incorrect
-
Question 10 of 30
10. Question
What will be the output of the program ?
#include
int main() { int i=3, *j, k; j = &i; printf("%d\n", i**j*i+*j); return 0; } Correct
Incorrect
-
Question 11 of 30
11. Question
What will be the output of the program ?
#include
int main() { int x=30, *y, *z; y=&x; /* Assume address of x is 500 and integer is 4 byte size */ z=y; *y++=*z++; x++; printf("x=%d, y=%d, z=%d\n", x, y, z); return 0; } Correct
Incorrect
-
Question 12 of 30
12. Question
What will be the output of the program ?
#include
int main() { char str[20] = "Hello"; char *const p=str; *p='M'; printf("%s\n", str); return 0; } Correct
Incorrect
-
Question 13 of 30
13. Question
What will be the output of the program If the integer is 4bytes long?
#include
int main() { int ***r, **q, *p, i=8; p = &i; q = &p; r = &q; printf("%d, %d, %d\n", *p, **q, ***r); return 0; } Correct
Incorrect
-
Question 14 of 30
14. Question
What will be the output of the program ?
#include
void fun(void *p); int i; int main() { void *vptr; vptr = &i; fun(vptr); return 0; } void fun(void *p) { int **q; q = (int**)&p; printf("%d\n", **q); } Correct
Incorrect
-
Question 15 of 30
15. Question
What will be the output of the program ?
#include
int main() { char *str; str = "%s"; printf(str, "K\n"); return 0; } Correct
Incorrect
-
Question 16 of 30
16. Question
What will be the output of the program ?
#include
int *check(static int, static int); int main() { int *c; c = check(10, 20); printf("%d\n", c); return 0; } int *check(static int i, static int j) { int *p, *q; p = &i; q = &j; if(i >= 45) return (p); else return (q); } Correct
Incorrect
-
Question 17 of 30
17. Question
What will be the output of the program if the size of pointer is 4-bytes?
#include
int main() { printf("%d, %d\n", sizeof(NULL), sizeof("")); return 0; } Correct
In TurboC, the output will be 2, 1 because the size of the pointer is 2 bytes in 16-bit platform.
But in Linux, the output will be 4, 1 because the size of the pointer is 4 bytes.
This difference is due to the platform dependency of C compiler.
Incorrect
In TurboC, the output will be 2, 1 because the size of the pointer is 2 bytes in 16-bit platform.
But in Linux, the output will be 4, 1 because the size of the pointer is 4 bytes.
This difference is due to the platform dependency of C compiler.
-
Question 18 of 30
18. Question
What will be the output of the program ?
#include
Correct
Incorrect
-
Question 19 of 30
19. Question
What will be the output of the program?
#include
int main() { int arr[2][2][2] = {10, 2, 3, 4, 5, 6, 7, 8}; int *p, *q; p = &arr[1][1][1]; q = (int*) arr; printf("%d, %d\n", *p, *q); return 0; } Correct
Incorrect
-
Question 20 of 30
20. Question
What will be the output of the program assuming that the array begins at the location 1002 and size of an integer is 4 bytes?
#include
int main() { int a[3][4] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 }; printf("%u, %u, %u\n", a[0]+1, *(a[0]+1), *(*(a+0)+1)); return 0; } Correct
Incorrect
-
Question 21 of 30
21. Question
What will be the output of the program?
#include
int main() { int arr[3] = {2, 3, 4}; char *p; p = arr; p = (char*)((int*)(p)); printf("%d, ", *p); p = (int*)(p+1); printf("%d", *p); return 0; } Correct
Incorrect
-
Question 22 of 30
22. Question
What will be the output of the program ?
#include
int main() { char *str; str = "%d\n"; str++; str++; printf(str-2, 300); return 0; } Correct
Incorrect
-
Question 23 of 30
23. Question
What will be the output of the program ?
#include
int main() { printf("%c\n", 7["IndiaBIX"]); return 0; } Correct
Incorrect
-
Question 24 of 30
24. Question
What will be the output of the program ?
#include
int main() { char str[] = "peace"; char *s = str; printf("%s\n", s++ +3); return 0; } Correct
Incorrect
-
Question 25 of 30
25. Question
What will be the output of the program ?
#include
int main() { char *p; p="hello"; printf("%s\n", *&*&p); return 0; } Correct
Incorrect
-
Question 26 of 30
26. Question
What will be the output of the program assuming that the array begins at location 1002?
#include
int main() { int a[2][3][4] = { {1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 1, 2}, {2, 1, 4, 7, 6, 7, 8, 9, 0, 0, 0, 0} }; printf("%u, %u, %u, %d\n", a, *a, **a, ***a); return 0; } Correct
Incorrect
-
Question 27 of 30
27. Question
What will be the output of the program ?
#include
power(int**); int main() { int a=5, *aa; /* Address of 'a' is 1000 */ aa = &a; a = power(&aa); printf("%d\n", a); return 0; } power(int **ptr) { int b; b = **ptr***ptr; return (b); } Correct
Incorrect
-
Question 28 of 30
28. Question
What will be the output of the program ?
#include
int main() { char str1[] = "India"; char str2[] = "BIX"; char *s1 = str1, *s2=str2; while(*s1++ = *s2++) printf("%s", str1); printf("\n"); return 0; } Correct
Incorrect
-
Question 29 of 30
29. Question
What will be the output of the program ?
#include
#include int main() { int i, n; char *x="Alice"; n = strlen(x); *x = x[n]; for(i=0; i"%s ", x); x++; } printf("\n", x); return 0; } Correct
If you compile and execute this program in windows platform with Turbo C, it will give “lice ice ce e”.
It may give different output in other platforms (depends upon compiler and machine). The online C compiler given in this site will give the Option C as output (it runs on Linux platform).
Incorrect
If you compile and execute this program in windows platform with Turbo C, it will give “lice ice ce e”.
It may give different output in other platforms (depends upon compiler and machine). The online C compiler given in this site will give the Option C as output (it runs on Linux platform).
-
Question 30 of 30
30. Question
What will be the output of the program ?
#include
int main() { int i, a[] = {2, 4, 6, 8, 10}; change(a, 5); for(i=0; i4; i++) printf("%d, ", a[i]); return 0; } void change(int *b, int n) { int i; for(i=0; i 1) = *(b+i)+5; } Correct
Incorrect
Well!This website is helpful.