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
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 |
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 |
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 |
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 |
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 |
how to calculate the time complexity of a given algorithm? pls give exaples..mainly for the coplexities such as O(log n),O(n log n)...
What is difference between function overloading and operator overloading?
how can i get the string which is having two spaces at the end.suppose the string is "Hello World ".Now at the end i have two spaces.i need to print with that spaces .
In C program, at end of the program we will give as "return 0" and "return 1", what they indicate? Is it mandatory to specify them?
Explain the meaning of keyword 'extern' in a function declaration.
Are there constructors in c?
hat is a pointer?
logic for generating all the combinations of the any number of given letters. ex::::::::: if a,b,c,d are given the o/p should be abcd,dcba,dbac,bcad,................ 4*3*2*1 combinations............
What is the use of header files?
There is a mobile keypad with numbers 0-9 and alphabets on it. take input of 7 keys and then form a word from the alphabets present on those keys.
how can u print a message without using any library function in c
Explain is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?