Question
QUESTION 1 What will be the output of following statements? char s[] = Learn C!!; printf ( %s, &s[1] ); A. L B. earn
QUESTION 1
-
What will be the output of following statements?
char s[] = "Learn C!!";
printf ( " %s", &s[1] );
A. L
B. earn C!!
C. Learn C!!
D. e
2 points
QUESTION 2
-
What will be the output of following Program code?
void fun(int, int*);
int main()
{
int i = -5, j = -2;
fun (i, &j);
printf("i = %d j = %d ", i, j);
return 0;
}
void fun (int i, int *j)
{
i = i*i;
*j = *j**j;
}
A. i = 25 j = 4
B. i = -25 j = -4
C. i = -5 j = 4
D. i = -5 j = -2
2 points
QUESTION 3
-
Which of the following is equivalent to ++*ptr , where ptr has been declared as:
int *ptr;
A. *ptr++
B. *(ptr++)
C. &ptr++
D. (*ptr)++
2 points
QUESTION 4
-
Any element of array declared as:
int arr[3][4];
can be accessed in pointer notation (where i represents row index and j represents column index) with generic formula as:
A. *(*arr + i +j)
B. **(arr + i) +j)
C. *(*(arr + i) +j)
D. (*(*(arr) + i) +j)
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