Question
QUESTION 5 In the following program, after Statement A is executed, the new address of ptr will be _________________ bytes more than the old address.
QUESTION 5
-
In the following program, after Statement A is executed, the new address of ptr will be _________________ bytes more than the old address. (Assume that each int is stored in 4 bytes.)
#include
int one_d[] = {1,2,3};
void main()
{
int *ptr;
ptr = one_d;
ptr +=3; /*Statement A*/
printf(%d , *ptr); /Statement B */
}
A. 12
B. 8
C. 3
D. 4
2 points
QUESTION 6
-
In the code given for Q5 above, what will statement B print?
A. 3
B. Garbage Value
C. 2
D. 1
2 points
QUESTION 7
-
What will be the output of following statements?
char *str= "Hello";
char *ptr = str;
printf("%c\t%c", 1[ptr], str[1]);
A. Run time Error
B. Garbage Value
C. l l
D. e e
2 points
QUESTION 8
-
What will be the output of following code snippet?
int k = 5;
int *p = &k;
int **m = &p;
**m = 6;
printf("%d ", k);
A. 5
B. 6
C. Garbage Value
D. Compile-time Error
2 points
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started