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 |
Write a program that find and print how many odd numbers in a binary tree
func(a,b) int a,b; { return( a= (a==b) ); } main() { int process(),func(); printf("The value of process is %d !\n ",process(func,3,6)); } process(pf,val1,val2) int (*pf) (); int val1,val2; { return((*pf) (val1,val2)); }
How do you create a really large matrix (i.e. 3500x3500) in C without having the program crash? I can only reach up to 2500. It must have something to do with lack of memory. Please help!
#define f(g,g2) g##g2 main() { int var12=100; printf("%d",f(var,12)); }
main() { int i = 3; for (;i++=0;) printf(“%d”,i); }
write a c program to Create employee record by taking details like name, employee id, address and phone number. While taking the phone number, take either landline or mobile number. Ensure that the phone numbers of the employee are unique. Also display all the details
main() { char a[4]="HELL"; printf("%s",a); }
main(int argc, char **argv) { printf("enter the character"); getchar(); sum(argv[1],argv[2]); } sum(num1,num2) int num1,num2; { return num1+num2; }
void main() { int i=i++,j=j++,k=k++; printf(“%d%d%d”,i,j,k); }
void ( * abc( int, void ( *def) () ) ) ();
main(){ unsigned int i; for(i=1;i>-2;i--) printf("c aptitude"); }
#include <stdio.h> #define a 10 main() { #define a 50 printf("%d",a); }