27. What will be the output of following code :
// Assume all header files are included
int main()
{
char *ptr1;
ptr1=(char*)malloc(6);
strcpy(ptr1,"Hello");
puts(ptr1);
ptr1=(char*)realloc(ptr1,15);
strcat(ptr1,"Readers!!");
puts(ptr1);
}
A.
Hello
HelloReaders!!
B.
Hello
C.
Hello
Readers
D. Readers
E. Runtime Error
View Answer & Explanation
Ans. A
28. What will be the output of following code :
// Assume all header files are included
main()
{
typedef int i;
i var=200;
printf("The value of variable var is %d",var);
}
A. The value of variable var is 0
B. The value of variable var is 200
C. Compilation Error
D. Runtime Error
View Answer & Explanation
Ans. B
