study the code:
#include<stdio.h>
void main()
{
const int a=100;
int *p;
p=&a;
(*p)++;
printf("a=%dn(*p)=%dn",a,*p);
}
What is printed?
A)100,101 B)100,100 C)101,101 D)None of the
above

Answers were Sorted based on User's Feedback



study the code: #include<stdio.h> void main() { const int a=100; int *p; p=&a; (*p)..

Answer / santhoo035

d)None of the above
It will give compliation error at the line p=&a,pointer to
integer cannot assign to const int

Is This Answer Correct ?    18 Yes 1 No

study the code: #include<stdio.h> void main() { const int a=100; int *p; p=&a; (*p)..

Answer / guest

D)

Is This Answer Correct ?    6 Yes 0 No

study the code: #include<stdio.h> void main() { const int a=100; int *p; p=&a; (*p)..

Answer / hima bindu sudhani

The answer is A)100, 101

Is This Answer Correct ?    6 Yes 2 No

study the code: #include<stdio.h> void main() { const int a=100; int *p; p=&a; (*p)..

Answer / madhu

D) NONE OF THE ABOVE
COZ
ANS IS A=101n (*p)=101n
to get this *p should be an constant pointer

Is This Answer Correct ?    3 Yes 1 No

study the code: #include<stdio.h> void main() { const int a=100; int *p; p=&a; (*p)..

Answer / sridevi.halli

answer is d)none of the above
bcoz in line p=&a it will gve error

Is This Answer Correct ?    2 Yes 0 No

study the code: #include<stdio.h> void main() { const int a=100; int *p; p=&a; (*p)..

Answer / abdur rab

the answer is c) 101, 101

a constant variable can be accessed using a pointer to
change the value because, during compilation the compiler
cannot see that the pointer is changing a contant read only
variable.

the same method can be applied over the private members in
a c++ class also.

Is This Answer Correct ?    3 Yes 1 No

study the code: #include<stdio.h> void main() { const int a=100; int *p; p=&a; (*p)..

Answer / y hussain reddy

101 ,101

Is This Answer Correct ?    0 Yes 0 No

study the code: #include<stdio.h> void main() { const int a=100; int *p; p=&a; (*p)..

Answer / traphunter

a=101n(*p)=101n

answer c)

Is This Answer Correct ?    0 Yes 0 No

study the code: #include<stdio.h> void main() { const int a=100; int *p; p=&a; (*p)..

Answer / divakar

ouput will be c)a=101 (*p)=101

Is This Answer Correct ?    1 Yes 2 No

study the code: #include<stdio.h> void main() { const int a=100; int *p; p=&a; (*p)..

Answer / biranchi ranjan parida

none of the above
pointer value of address increases it cant store its
original value

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More C Interview Questions

which will be first in c compiling ,linking or compiling ,debugging.

3 Answers   Sonata,


Given an array of 1s and 0s arrange the 1s together and 0s together in a single scan of the array. Optimize the boundary conditions?

0 Answers   Infosys,


Why & is used in c?

0 Answers  


What does #pragma once mean?

0 Answers   Celstream,


What is Your Name :)

1 Answers  






Is fortran still used in 2018?

0 Answers  


What is memmove?

1 Answers   Oracle,


write a program which the o/p should b in such a way that s triangle if I/p is 3,a Square/rectangle if I/P=4,a pentagon if I/P=5 and so on...forget about the I/P which is less than 3

0 Answers   ADP,


Why is c called c not d or e?

0 Answers  


Why can arithmetic operations not be performed on void pointers?

0 Answers  


Write a c program to demonstrate Type casting in c?

2 Answers  


what is the difference between postfix and prefix unary increment operators?

3 Answers  


Categories