void main()

{

int const * p=5;

printf("%d",++(*p));

}

Answers were Sorted based on User's Feedback



void main() { int const * p=5; printf("%d",++(*p)); }..

Answer / susie

Answer :

Compiler error: Cannot modify a constant value.

Explanation:

p is a pointer to a "constant integer". But we
tried to change the value of the "constant integer".

Is This Answer Correct ?    78 Yes 10 No

void main() { int const * p=5; printf("%d",++(*p)); }..

Answer / mahe

5
pointer value does not change.so print thier value

Is This Answer Correct ?    3 Yes 8 No

void main() { int const * p=5; printf("%d",++(*p)); }..

Answer / jambalakadi pamba

here...p is a pointer which is pointing to a addresss which is constant....!!! so the output is 6

Is This Answer Correct ?    8 Yes 22 No

Post New Answer

More C Code Interview Questions

main() { int i; float *pf; pf = (float *)&i; *pf = 100.00; printf("\n %d", i); } a. Runtime error. b. 100 c. Some Integer not 100 d. None of the above

2 Answers   HCL, LG,


main() { extern out; printf("%d", out); } int out=100;

1 Answers  


¦void main() ¦{ ¦int i=10,j; ¦ j=i+++i+++i; ¦printf("%d",j); ¦getch(); ¦} ¦ output:-30 but in same question if we write as- ¦void main() ¦{ ¦int i=10; ¦ int j=i+++i+++i; ¦printf("%d",j); ¦getch(); ¦} ¦ output:-33 why output is changed from 30 to 33. Can any body answer...

3 Answers  


Given n nodes. Find the number of different structural binary trees that can be formed using the nodes.

16 Answers   Aricent, Cisco, Directi, Qualcomm,


program to find the roots of a quadratic equation

14 Answers   College School Exams Tests, Engineering, HP, IIIT, Infosys, Rajiv Gandhi University of Knowledge Technologies RGUKT, SSC,






#define a 10 void foo() { #undef a #define a 50 } int main() { printf("%d..",a); foo(); printf("%d..",a); return 0; } explain the answer

1 Answers  


main(int argc, char **argv) { printf("enter the character"); getchar(); sum(argv[1],argv[2]); } sum(num1,num2) int num1,num2; { return num1+num2; }

1 Answers  


What is "far" and "near" pointers in "c"...?

3 Answers  


main ( ) { static char *s[ ] = {“black”, “white”, “yellow”, “violet”}; char **ptr[ ] = {s+3, s+2, s+1, s}, ***p; p = ptr; **++p; printf(“%s”,*--*++p + 3); }

1 Answers  


#define FALSE -1 #define TRUE 1 #define NULL 0 main() { if(NULL) puts("NULL"); else if(FALSE) puts("TRUE"); else puts("FALSE"); }

1 Answers  


main() { char *a = "Hello "; char *b = "World"; clrscr(); printf("%s", strcat(a,b)); } a. Hello b. Hello World c. HelloWorld d. None of the above

3 Answers   HCL,


void main() { static int i; while(i<=10) (i>2)?i++:i--; printf(“%d”, i); }

2 Answers  


Categories