What will be the result of the following program?
main()
{
char p[]="String";
int x=0;
if(p=="String")
{
printf("Pass 1");
if(p[sizeof(p)-2]=='g')
printf("Pass 2");
else
printf("Fail 2");
}
else
{
printf("Fail 1");
if(p[sizeof(p)-2]=='g')
printf("Pass 2");
else
printf("Fail 2");
}
}
a) Pass 1, Pass 2
b) Fail 1, Fail 2
c) Pass 1, Fail 2
d) Fail 1, Pass 2
e) syntax error during compilation
Answer Posted / reepal
e) syntex error during compilation
| Is This Answer Correct ? | 3 Yes | 1 No |
Post New Answer View All Answers
What are the types of pointers?
What is the -> in c?
Can the “if” function be used in comparing strings?
What is the data segment that is followed by c?
How can I read in an object file and jump to locations in it?
Does c have circular shift operators?
Why flag is used in c?
What oops means?
What is context in c?
What is #line in c?
Explain threaded binary trees?
What is linear search?
Explain what is a static function?
Hai,I have done with my bachelor of commerce and planing to ms,please suggest me how to convince vo for shifting from commerce to computers. Visa on 8 DEC 2014 Npu university
What is the purpose of main( ) in c language?