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
Fail 1,Fail 2
| Is This Answer Correct ? | 0 Yes | 2 No |
Post New Answer View All Answers
What are the 4 types of organizational structures?
What is 'bus error'?
In which layer of the network datastructure format change is done
Explain what is the benefit of using an enum rather than a #define constant?
What does the error 'Null Pointer Assignment' mean and what causes this error?
What is nested structure in c?
What is difference between scanf and gets?
pgm to find any error in linklist(in single linklist check whether any node points any of previous nodes instead of next node)
A character flag or control mechanism that delineates one data item from another a) variable b) constant c) delimiter d) call by reference
How would you obtain the current time and difference between two times?
What are local static variables?
What tq means in chat?
What is operator precedence?
which of the following statement is wrong a) mes=123.56; b) con='T'*'A'; c) this='T'*20; d) 3+a=b;
What is c programming structure?