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 is volatile variable how do you declare it?
Want to know how to write a C program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL.
How can I write a function analogous to scanf?
What language is c written?
What are valid signatures for the Main function?
Give differences between - new and malloc() , delete and free() ?
How do I use void main?
When should you use a type cast?
Where in memory are my variables stored?
What is "Hungarian Notation"?
How do you list files in a directory?
can anyone suggest some site name..where i can get some good data structure puzzles???
What will be the outcome of the following conditional statement if the value of variable s is 10?
Explain how do you print an address?
Write the Program to reverse a string using pointers.