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
In which header file is the null macro defined?
what is bit rate & baud rate? plz give wave forms
Are the outer parentheses in return statements really optional?
Explain how to reverse singly link list.
can we have joblib in a proc ?
What are the features of c languages?
What is selection sort in c?
How can you pass an array to a function by value?
What is keyword with example?
Explain how do you print only part of a string?
Explain which of the following operators is incorrect and why? ( >=, <=, <>, ==)
Explain how do you view the path?
What is wild pointer in c with example?
What is the best way to store flag values in a program?
Give a one-line C expression to test whether a number is a power of 2. [No loops allowed - it's a simple test.]