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 / guest
c)Pass 1, Fail 2
| Is This Answer Correct ? | 1 Yes | 2 No |
Post New Answer View All Answers
What is difference between stdio h and conio h?
Can I use base-2 constants (something like 0b101010)? Is there a printf format for binary?
How is = symbol different from == symbol in c programming?
What are keywords c?
Hi how many types of software editions are there and their difference (like home editions, enterprise, standard etc) can u please help me
What is the use of getchar() function?
What is the c language function prototype?
What is a char c?
What are the advantage of c language?
Difference between Function to pointer and pointer to function
hai iam working in sap sd module for one year and working in lumax ind ltd in desp department but my problem is i have done m.b.a in hr/marketing and working sap sd there is any combination it. can you give right solution of my problem. and what can i do?
How many types of arrays are there in c?
Why does everyone say not to use gets?
How main function is called in c?
Which node is more powerful and can handle local information processing or graphics processing?