main()
{
char *p = “ayqm”;
printf(“%c”,++*(p++));
}
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
#include <stdio.h> int main(void) { int a=4, b=2; a=b<<a+b>>2 ; printf("%d",a); return 0; }
Extend the sutherland-hodgman clipping algorithm to clip three-dimensional planes against a regular paralleiepiped
print numbers till we want without using loops or condition statements like specifically(for,do while, while swiches, if etc)!
main() { int i=-1; +i; printf("i = %d, +i = %d \n",i,+i); }
main() { printf("%x",-1<<4); }
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']
Print an integer using only putchar. Try doing it without using extra storage.
Cluster head selection in Wireless Sensor Network using C programming language.
main() { int i=3; switch(i) { default:printf("zero"); case 1: printf("one"); break; case 2:printf("two"); break; case 3: printf("three"); break; } }
Find the largest number in a binary tree
main() { int i = 0xff ; printf("\n%d", i<<2); } a. 4 b. 512 c. 1020 d. 1024
How we will connect multiple client ? (without using fork,thread)