C Programming and Technical

output??
main()
{
char *p;
p="Hello";
printf("%cn",*&*p);
}

A. 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. Again & references it to an address and * dereferences it to the value H.

Read Solution (Total 0)

C Other Question

output??
main()
{i
nt i=400,j=300;
printf("%d..%d");
}

A. 400..300

Explanation: printf takes the values of the first two assignments of the program. Any number of printf's may be given. All of them take only the first two values. If more number of assignments given in the program,then printf will take garbage values.
output?
main()
{i
nt i=1;
while (i2)
goto here;
i++;
}} fun()
{
here:
printf("PP");
}

A. Compiler error: Undefined label 'here' in function main

Explanation: Labels have functions scope, in other words the scope of the labels is limited to functions. The label 'here' is available in function fun() Hence it is not visible in function main