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
please can any one suggest me best useful video tutorials on c i am science graduate.please help me.u can email me to sas29@in.com
Write a simple code fragment that will check if a number is positive or negative.
How would you use the functions fseek(), freed(), fwrite() and ftell()?
What are structural members?
Does c have enums?
How to write a multi-statement macro?
Can you add pointers together? Why would you?
Can a pointer point to null?
What is time null in c?
What is LINKED LIST? How can you access the last element in a linked list?
What is the difference between break and continue?
Is fortran still used in 2018?
Why static is used in c?
Explain c preprocessor?
What are static variables in c?