main()
{
char *p;
p="Hello";
printf("%c\n",*&*p);
}

Answers were Sorted based on User's Feedback



main() { char *p; p="Hello"; printf("%c\n",*&*p); } ..

Answer / surenda pal singh chouhan

H

Explanation:
* is a dereference operator & is a reference operator.
They can be applied any number of times provided it is
meaningful. Here p points to the first character in the
string "Hello". *p dereferences it and so its value is H.

Is This Answer Correct ?    23 Yes 1 No

main() { char *p; p="Hello"; printf("%c\n",*&*p); } ..

Answer / vignesh1988i

the output will be 'H'...... this is because... first the
variables with pointers as:
*
&
*
p
so it woill process as givwn above in stack

Is This Answer Correct ?    10 Yes 2 No

Post New Answer

More C Interview Questions

What is the output for the following program #include<stdio.h> main() { char a[5][5],flag; a[0][0]='A'; flag=((a==*a)&&(*a==a[0])); printf("%d\n",flag); }

5 Answers   ADITI, Wipro,


What is difference between constant pointer and constant variable?

0 Answers   Hexaware,


How can you access memory located at a certain address?

0 Answers  


difference between spiral and waterfall model

1 Answers  


How can I invoke another program (a standalone executable, or an operating system command) from within a c program?

0 Answers  






Efficient data structure for store/search list of 1000 records a)array b)double linked list c)circular queue d)hash table

3 Answers   Value Labs,


a c variable cannot start with a) an alphabet b) a number c) a special symbol d) both b and c above

0 Answers  


what is the output of the following program and explain the answer #include<stdio.h> exp() { main(5) } main(int a) { printf("%d",a); return; }

3 Answers   Satyam,


Write one statement equalent to the following two statements x=sqr(a); return(x); Choose from one of the alternatives a.return(sqr(a)); b.printf("sqr(a)"); c.return(a*a*a); d.printf("%d",sqr(a));

6 Answers   TCS,


a simple c program using 'for' loop to display the output 5 4 3 2 1

2 Answers   Google,


what is the return value (status code) of exit() function.... what the arguments(integer value) passed to it means....

1 Answers   TCS,


Write a program that receives as input a number omaadel-n-print, four digits.

0 Answers  


Categories