main( )
{
void *vp;
char ch = ‘g’, *cp = “goofy”;
int j = 20;
vp = &ch;
printf(“%c”, *(char *)vp);
vp = &j;
printf(“%d”,*(int *)vp);
vp = cp;
printf(“%s”,(char *)vp + 3);
}
Answer / susie
Answer :
g20fy
Explanation:
Since a void pointer is used it can be type casted to any
other type pointer. vp = &ch stores address of char ch and
the next statement prints the value stored in vp after type
casting it to the proper data type pointer. the output is
‘g’. Similarly the output from second printf is ‘20’. The
third printf statement type casts it to print the string
from the 4th value hence the output is ‘fy’.
Is This Answer Correct ? | 4 Yes | 0 No |
how to concatenate the two strings
how to return a multiple value from a function?
main() { printf("%x",-1<<4); }
#define square(x) x*x main() { int i; i = 64/square(4); printf("%d",i); }
4 Answers Google, HCL, Quick Heal, WTF,
main() { int i; clrscr(); printf("%d", &i)+1; scanf("%d", i)-1; } a. Runtime error. b. Runtime error. Access violation. c. Compile error. Illegal syntax d. None of the above
main() { float me = 1.1; double you = 1.1; if(me==you) printf("I love U"); else printf("I hate U"); }
What is "far" and "near" pointers in "c"...?
void main() { int c; c=printf("Hello world"); printf("\n%d",c); }
how to programme using switch statements and fuctions, a programme that will output two even numbers, two odd numbers and two prime numbers of the users chioce.
0 Answers Mbarara University of Science and Technology,
write a program in c language to get the value of arroy keys pressed and display the message which arrow key is pressed?
#include<stdio.h> main() { FILE *ptr; char i; ptr=fopen("zzz.c","r"); while((i=fgetch(ptr))!=EOF) printf("%c",i); }
Given n nodes. Find the number of different structural binary trees that can be formed using the nodes.
16 Answers Aricent, Cisco, Directi, Qualcomm,