Java C Pointers Test 2 - 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 2 – Java C Pointers Question and Answers. Free Java C Pointers Quiz, Take Free online Test Quiz 2. Java C Pointers Quiz 2 Question and Answers 2019. Java online Test Quiz 2. Java C Pointers Quiz 2 Free Mock Test 2019. Java C Pointers Quiz 2 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 2 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
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 “, a[0]+1, *(a[0]+1), *(*(a+0)+1));
return 0;
}Correct
Incorrect
-
Question 2 of 20
2. Question
What will be the output of the program if the size of pointer is 4-bytes?
#include
int main()
{
printf(“%d, %d “, 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 3 of 20
3. Question
What will be the output of the program ?
#include
int main()
{
char *str;
str = “%s”;
printf(str, “K “);
return 0;
}Correct
What will be the output of the program ?
#include
int main()
{
char *str;
str = “%s”;
printf(str, “K “);
return 0;
}Incorrect
What will be the output of the program ?
#include
int main()
{
char *str;
str = “%s”;
printf(str, “K “);
return 0;
} -
Question 4 of 20
4. 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 “, **q);
}Correct
Incorrect
-
Question 5 of 20
5. 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 “, *p, **q, ***r);
return 0;
}Correct
Incorrect
-
Question 6 of 20
6. 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 7 of 20
7. Question
What will be the output of the program ?
#include
int main()
{
char *p;
p=”hello”;
printf(“%s “, *&*&p);
return 0;
}Correct
Incorrect
-
Question 8 of 20
8. 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 “, *p, *q);
return 0;
}Correct
Incorrect
-
Question 9 of 20
9. Question
What will be the output of the program ?
#include
int main()
{
void *vp;
char ch=74, *cp=”JACK”;
int j=65;
vp=&ch;
printf(“%c”, *(char*)vp);
vp=&j;
printf(“%c”, *(int*)vp);
vp=cp;
printf(“%s”, (char*)vp+2);
return 0;
}Correct
Incorrect
-
Question 10 of 20
10. Question
What will be the output of the program ?
#include
int main()
{
char str[20] = “Hello”;
char *const p=str;
*p=´M´;
printf(“%s “, str);
return 0;
}Correct
Incorrect
-
Question 11 of 20
11. Question
What will be the output of the program ?
#include
int main()
{
printf(“%c “, 7[“JavaTpoint”]);
return 0;
}Correct
Incorrect
-
Question 12 of 20
12. 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 “, a);
return 0;
}
power(int **ptr)
{
int b;
b = **ptr***ptr;
return (b);
}Correct
Incorrect
-
Question 13 of 20
13. Question
Which of the following statements correctly declare a function that receives a pointer to pointer to a pointer to a float and returns a pointer to a pointer to a pointer to a pointer to a float?
Correct
Incorrect
-
Question 14 of 20
14. Question
What will be the output of the program ?
#include
int main()
{
char str[] = “peace”;
char *s = str;
printf(“%s “, s++ +3);
return 0;
}Correct
Incorrect
-
Question 15 of 20
15. Question
What will be the output of the program ?
#include
int main()
{
char *str;
str = “%d “;
str++;
str++;
printf(str-2, 300);
return 0;
}Correct
Incorrect
-
Question 16 of 20
16. Question
If the size of integer is 4bytes, What will be the output of the program?
#include
int main()
{
int arr[] = {12, 13, 14, 15, 16};
printf(“%d, %d, %d “, sizeof(arr), sizeof(*arr), sizeof(arr[0]));
return 0;
}Correct
Incorrect
-
Question 17 of 20
17. Question
What will be the output of the program ?
#include
#includeint main()
{
int i, n;
char *x=”Alice”;
n = strlen(x);
*x = x[n];
for(i=0; i {
printf(“%s “, x);
x++;
}
printf(” “, 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 18 of 20
18. 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 “, a, *a, **a, ***a);
return 0;
}Correct
Incorrect
-
Question 19 of 20
19. 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; i printf(“%d, “, a[i]);
return 0;
}
void change(int *b, int n)
{
int i;
for(i=0; i*(b+1) = *(b+i)+5;
}Correct
Incorrect
-
Question 20 of 20
20. Question
Can you combine the following two statements into one?
char *p;
p = (char*) malloc(100);Correct
Incorrect