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
a) Pass 1, Pass 2
Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
What is anagram in c?
Is fortran still used in 2018?
What is a pointer in c?
What is substring in c?
Is register a keyword in c?
which of the following is allowed in a "C" arithematic instruction a) [] b) {} c) () d) none of the above
a formula,a series of steps,or well defined set of rules for solving a problem a) algorithem b) program c) erdiagram d) compiler
What is sizeof int in c?
What is the correct declaration of main?
What is the code in while loop that returns the output of given code?
How can I do peek and poke in c?
a function gets called when the function name is followed by a a) semicolon (;) b) period(.) c) ! d) none of the above
What is static volatile in c?
Why doesnt that code work?
List the variables are used for writing doubly linked list program.