Top

Pointers

51.

Which of the following are correct syntaxes to send an array as a parameter to function:

Answer: B

No answer description available for this question.
 

Enter details here

52.

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;
}

 

Answer: A

No answer description available for this question.

Enter details here

53.

What is the output of this C code?
 

int x = 0;
void main()
{
int *ptr = &x;
printf("%p\n", ptr);
x++;
printf("%p\n ", ptr);
}

 

Answer: A

No answer description available for this question.
 

Enter details here

54.

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;
}

 

Answer: B

No answer description available for this question.
 

Enter details here

55.

Will the following program give any warning on compilation in TurboC (under DOS)?

#include

int main()
{
    int *p1, i=25;
    void *p2;
    p1=&i;
    p2=&i;
    p1=p2;
    p2=p1;
    return 0;
}

 

Answer: B

No answer description available for this question.
 

Enter details here

56.

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;
}

 

Answer: D

No answer description available for this question.

Enter details here

57.

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);
}

 

Answer: D

No answer description available for this question.

Enter details here

58.

Point out the compile time error in the program given below.

#include

int main()
{
    int *x;
    *x=100;
    return 0;
}

 

Answer: C

No answer description available for this question.
 

Enter details here

59.

What is the output of this C code?

void main()
{
int a[3] = {1, 2, 3};
int *p = a;
int **r = &p;
printf("%p %p", *r, a);
}

 

Answer: C

No answer description available for this question.
 

Enter details here

60.

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;
}

 

Answer: A

No answer description available for this question.
 

Enter details here

Loading…
Tags: Pointers Questions and Answers || Pointers MCQ Questions and Answers || Pointers GK Questions and Answers || Pointers GK MCQ Questions || Pointers Multiple Choice Questions and Answers || Pointers GK || GK on Pointers || C Programming Questions and Answers || C Programming MCQ Questions and Answers || C Programming GK Questions and Answers || GK on C Programming