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=4,j=7; j = j || i++ && printf("YOU CAN"); printf("%d %d", i, j); }

1 Answers  


main() { int x=5; for(;x!=0;x--) { printf("x=%d\n", x--); } } a. 5, 4, 3, 2,1 b. 4, 3, 2, 1, 0 c. 5, 3, 1 d. none of the above

2 Answers   HCL,


What is data _null_? ,Explain with code when u need to use it in data step programming ?

0 Answers   Abbott,


What are the files which are automatically opened when a C file is executed?

1 Answers  


write a origram swaoing valu without 3rd variable

2 Answers  






create a login program that ask username and password. if you input username or password 3 times wrong, the program will terminate else the program will prompt a message "congratulations"

2 Answers  


Write a C program to print look and say sequence? For example if u get the input as 1 then the sequence is 11 21 1211 111221 312211 12112221 .......(it counts the no. of 1s,2s etc which is in successive order) and this sequence is used in run-length encoding.

1 Answers  


There were 10 records stored in “somefile.dat” but the following program printed 11 names. What went wrong? void main() { struct student { char name[30], rollno[6]; }stud; FILE *fp = fopen(“somefile.dat”,”r”); while(!feof(fp)) { fread(&stud, sizeof(stud), 1 , fp); puts(stud.name); } }

1 Answers  


void main() { char ch; for(ch=0;ch<=127;ch++) printf(“%c %d \n“, ch, ch); }

1 Answers  


#define DIM( array, type) sizeof(array)/sizeof(type) main() { int arr[10]; printf(“The dimension of the array is %d”, DIM(arr, int)); }

1 Answers  


main() { int (*functable[2])(char *format, ...) ={printf, scanf}; int i = 100; (*functable[0])("%d", i); (*functable[1])("%d", i); (*functable[1])("%d", i); (*functable[0])("%d", &i); } a. 100, Runtime error. b. 100, Random number, Random number, Random number. c. Compile error d. 100, Random number

1 Answers   HCL, rsystems,


write a c program to Create a registration form application by taking the details like username, address, phone number, email along with password and confirm password (should be same as password).Ensure that the password is of 8 characters with only numbers and alphabets. Take such details for 5 users and display the details. In place of password display “****”. (Use Structures).

0 Answers   CDAC, College School Exams Tests,


Categories