Java C Pointers Test 1 - Java C Pointers Question and Answers
Finish Quiz
0 of 20 questions completed
Questions:
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
Information
Lets Play with our Java C Pointers Test 1 – Java C Pointers Question and Answers. Free Java C Pointers Quiz, Take Free online Test Quiz 1. Java C Pointers Quiz 1 Question and Answers 2024. Java online Test Quiz 1. Java C Pointers Quiz 1 Free Mock Test 2024. Java C Pointers Quiz 1 Question and Answers in PDF. The Java online mock test paper is free for all students. Spring Online is very useful for exam preparation and getting for Rank. Java C Pointers Quiz 1 Question and Answers in English. Java C Pointers Mock test for topic via C Pointers Mode. Here we are providing Java C Pointers Quiz in English Now Test your self for “C Pointers Online Quiz in English” Exam by using below quiz…
This paper has 20 questions.
Time allowed is 25 minutes.
The Java C Pointers Mock Test 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 20 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
- Answered
- Review
-
Question 1 of 20
1. Question
Are the three declarations char **apple, char *apple[], and char apple[][] same?
Correct
Incorrect
-
Question 2 of 20
2. Question
Is the NULL pointer same as an uninitialised pointer?
Correct
Incorrect
-
Question 3 of 20
3. Question
Will the program compile in Turbo C?
#include<stdio.h>
int main()
{
int a=10, *j;
void *k;
j=k=&a;
j++;
k++;
printf(“%u %u “, j, k);
return 0;
}Correct
Error in statement k++. We cannot perform arithmetic on void pointers.
The following error will be displayed while compiling above program in TurboC.
Compiling PROGRAM.C:
Error PROGRAM.C 8: Size of the type is unknown or zero.Incorrect
Error in statement k++. We cannot perform arithmetic on void pointers.
The following error will be displayed while compiling above program in TurboC.
Compiling PROGRAM.C:
Error PROGRAM.C 8: Size of the type is unknown or zero. -
Question 4 of 20
4. Question
Is this a correct way for NULL pointer assignment?
int i=0;
char *q=(char*)i;Correct
The correct way is char *q=0 (or) char *q=(char*)0
Incorrect
The correct way is char *q=0 (or) char *q=(char*)0
-
Question 5 of 20
5. Question
Is there any difference between the following two statements?
char *p=0;
char *t=NULL;Correct
NULL is #defined as 0 in the stdio.h file. Thus, both p and t are NULL pointers.
Incorrect
NULL is #defined as 0 in the stdio.h file. Thus, both p and t are NULL pointers.
-
Question 6 of 20
6. Question
Will the following program give any warning on compilation in TurboC (under DOS)?
#include<stdio.h>
int main()
{
int *p1, i=25;
void *p2;
p1=&i;
p2=&i;
p1=p2;
p2=p1;
return 0;
}Correct
Incorrect
-
Question 7 of 20
7. Question
The following program reports an error on compilation.
#include<stdio.h>
int main()
{
float i=10, *j;
void *k;
k=&i;
j=k;
printf(“%f “, *j);
return 0;
}Correct
This program will NOT report any error. (Tested in Turbo C under DOS and GCC under Linux)
The output: 10.000000Incorrect
This program will NOT report any error. (Tested in Turbo C under DOS and GCC under Linux)
The output: 10.000000 -
Question 8 of 20
8. Question
Are the expression *ptr++ and ++*ptr are same?
Correct
*ptr++ increments the pointer and not the value, whereas the ++*ptr increments the value being pointed by ptr
Incorrect
*ptr++ increments the pointer and not the value, whereas the ++*ptr increments the value being pointed by ptr
-
Question 9 of 20
9. Question
Will the program compile?
#include<stdio.h>
int main()
{
char str[5] = “JavaTpoint”;
return 0;
}Correct
C does not do array bounds checking at compile time, hence this compiles.
But, the modern compilers like Turbo C++ detects this as Error: Too many initializers.
GCC would give you a warning.Incorrect
C does not do array bounds checking at compile time, hence this compiles.
But, the modern compilers like Turbo C++ detects this as Error: Too many initializers.
GCC would give you a warning. -
Question 10 of 20
10. Question
A pointer is
Correct
Incorrect
-
Question 11 of 20
11. Question
What will be the output of the program ?
#include<stdio.h>
int main()
{
int i=3, *j, k;
j = &i;
printf(“%d “, i**j*i+*j);
return 0;
}Correct
Incorrect
-
Question 12 of 20
12. Question
What is (void*)0?
Correct
Incorrect
-
Question 13 of 20
13. Question
Can you combine the following two statements into one?
char *p;
p = (char*) malloc(100);Correct
Incorrect
-
Question 14 of 20
14. Question
The operator used to get value at address stored in a pointer variable is
Correct
Incorrect
-
Question 15 of 20
15. Question
What will be the output of the program ?
#include<stdio.h>
int main()
{
static char *s[] = {“black”, “white”, “pink”, “violet”};
char **ptr[] = {s+3, s+2, s+1, s}, ***p;
p = ptr;
++p;
printf(“%s”, **p+1);
return 0;
}Correct
Incorrect
-
Question 16 of 20
16. 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 17 of 20
17. 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 18 of 20
18. Question
What would be the equivalent pointer expression for referring the array element a[i][j][k][l]
Correct
Incorrect
-
Question 19 of 20
19. 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 20 of 20
20. Question
What will be the output of the program ?
#include<stdio.h>
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 “, x, y, z);
return 0;
}Correct
Incorrect