main()

{

char *p = “ayqm”;

printf(“%c”,++*(p++));

}

Answers were Sorted based on User's Feedback



main() { char *p = “ayqm”; printf(“%c”,++*(p++)); }..

Answer / susie

Answer :

b

Is This Answer Correct ?    155 Yes 26 No

main() { char *p = “ayqm”; printf(“%c”,++*(p++)); }..

Answer / kirit vaghela

p is char pointer that store the address of string "ayqm"
that means p have the address of 'a'.
if we write printf("%c",*p);
we get the output 'a';
now the *(p++) is post-increment that means it print the
value than increment the address by 1.
so *(p++) is print the value 'a'.
at finally ++*(p++) is increment the ascii value of 'a' by 1.
so it become 'b'.
the final output is 'b'.

Is This Answer Correct ?    88 Yes 6 No

main() { char *p = “ayqm”; printf(“%c”,++*(p++)); }..

Answer / sanjay

b

Is This Answer Correct ?    24 Yes 3 No

main() { char *p = “ayqm”; printf(“%c”,++*(p++)); }..

Answer / vikas patel

b

Is This Answer Correct ?    25 Yes 13 No

main() { char *p = “ayqm”; printf(“%c”,++*(p++)); }..

Answer / vikas mathur

correct answer is :- b
why because
p is a char pointer that holds the base address of
string"ayqm". so p points to address where 'a' is stored.
p++ is a post increnment statement so p will still points
to a but after this printf statement p will start pointing
to 'y'.
now *(p++) will return the values at address pointed by p
which is 'a'. and ++*(p++) means ++'a' which returns 'b'
so correct answer is b

Is This Answer Correct ?    13 Yes 3 No

main() { char *p = “ayqm”; printf(“%c”,++*(p++)); }..

Answer / anu-priya

the answer is b..
char *p="ayqm"; p a character pointer points to the base add
of string ie a...
printf("%c",*p); will print a....
printf("%c",*(p++)); will print a....
when we post increment the p then it will giv answer a..but
it wil increment by 1
printf("%c",++*(p++));
here it is ++a will print b....

Is This Answer Correct ?    9 Yes 4 No

main() { char *p = “ayqm”; printf(“%c”,++*(p++)); }..

Answer / ana

b

Is This Answer Correct ?    10 Yes 6 No

main() { char *p = “ayqm”; printf(“%c”,++*(p++)); }..

Answer / mukesh yadav

b

Is This Answer Correct ?    5 Yes 1 No

main() { char *p = “ayqm”; printf(“%c”,++*(p++)); }..

Answer / sumesh

the output of given problem will be :- b .
because %c in the printf function will take only one word of *p.and then its increasing one value by ++.

Is This Answer Correct ?    3 Yes 0 No

main() { char *p = “ayqm”; printf(“%c”,++*(p++)); }..

Answer / leka

b

Is This Answer Correct ?    4 Yes 2 No

Post New Answer

More C Code Interview Questions

main() { int i=300; char *ptr = &i; *++ptr=2; printf("%d",i); }

4 Answers   CSC,


Code for 1>"ascii to string" 2>"string to ascii"

1 Answers   Aricent, Global Logic,


#include"math.h" void main() { printf("Hi everybody"); } if <stdio.h> will be included then this program will must compile, but as we know that when we include a header file in "" then any system defined function find its defination from all the directrives. So is this code of segment will compile? If no then why?

2 Answers  


Write a program that produces these three columns sequence nos. using loop statement Sequence nos. Squared Squared + 5 1 1 6 2 4 9 3 9 14 4 16 21 5 25 30

1 Answers   GoDB,


main() { int i=5; printf(“%d”,i=++i ==6); }

1 Answers  






To reverse an entire text file into another text file.... get d file names in cmd line

0 Answers   Subex,


how can u draw a rectangle in C

53 Answers   Accenture, CO, Codeblocks, Cognizant, HCL, Oracle, Punjab National Bank, SAP Labs, TCS, University, Wipro,


Extend the sutherland-hodgman clipping algorithm to clip three-dimensional planes against a regular paralleiepiped

1 Answers   IBM,


To Write a C program to remove the repeated characters in the entered expression or in entered characters(i.e) removing duplicates. String contains only lowercase characters ['a'-'z']

0 Answers  


Write a program that reads a dynamic array of 40 integers and displays only even integers

2 Answers  


Display the time of the system and display the right time of the other country

1 Answers  


main() { printf("%d, %d", sizeof('c'), sizeof(100)); } a. 2, 2 b. 2, 100 c. 4, 100 d. 4, 4

18 Answers   HCL, IBM, Infosys, LG Soft, Satyam,


Categories