Thursday, 16 August 2012

What is the output if you compile and execute the following c code? | C Programming

#include <stdio.h>
#include <string.h>
int main()
{
char*str=NULL;
strcpy(str,"cquestionbank");
printf("%s",str);
return0;
}


A. cquestionbank
B. cquestionbank\0
C.. (null)
D. It will print nothing
E. Compiler error

Ans: C

No comments: