Const

Q1:
What will be the output of the program in TurboC?
#include<stdio.h>
int fun(int **ptr);

int main()
{
    int i=10, j=20;
    const int *ptr = &i;
    printf(' i = %5X', ptr);
    printf(' ptr = %d', *ptr);
    ptr = &j;
    printf(' j = %5X', ptr);
    printf(' ptr = %d', *ptr);
    return 0;
}

A i= FFE2 ptr=12 j=FFE4 ptr=24

B i= FFE4 ptr=10 j=FFE2 ptr=20

C Garbage value

D i= FFE0 ptr=20 j=FFE1 ptr=30

ANS:A - i= FFE2 ptr=12 j=FFE4 ptr=24

No answer description is available. Let's discuss.



img not found
img

For help Students Orientation
Mcqs Questions

One stop destination for examination, preparation, recruitment, and more. Specially designed online test to solve all your preparation worries. Go wherever you want to and practice whenever you want, using the online test platform.