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

An array name contains base address of the array. Can we change the base address of the array?

4 Answers   NMIMS, Wipro,


What is pointers in c with example?

0 Answers  


what are the uses of structure?

7 Answers   HCL,


Is c functional or procedural?

1 Answers  


a single linked list consists of nodes a to z .print the nodes in reverse order from z to a using recursion

0 Answers   Mindteck,






why integer range between -327680to+32767

2 Answers  


write a program to find lcm and hcf of two numbers??

1 Answers  


What is information technology.

1 Answers  


. Consider the following program main() { int a[5]={1,3,6,7,0}; int *b; b=&a[2]; } The value of b[-1] is (A) 1 (B) 3 (C) -6 (D) none

9 Answers   Oracle,


Can a void pointer point to a function?

0 Answers  


#include main() { int *p, *c, i; i = 5; p = (int*) (malloc(sizeof(i))); printf(" %d",*p); *p = 10; printf(" %d %d",i,*p); c = (int*) calloc(2); printf(" %d ",*c); }

0 Answers   Wilco,


A marketing company wishes to construct a decision table to decide how to treat clients according to three characteristics: Gender, City Dweller, and age group: A (under 30), B (between 30 and 60), C (over 60). The company has four products (W, X, Y and Z) to test market. Product W will appeal to female city dwellers. Product X will appeal to young females. Product Y will appeal to Male middle aged shoppers who do not live in cities. Product Z will appeal to all but older females.

2 Answers  


Categories