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 / vinay deore
Fail 1,Fail 2
Is This Answer Correct ? | 0 Yes | 2 No |
Post New Answer View All Answers
write a program in c language to print your bio-data on the screen by using functions.
Are pointers integer?
How can I read a binary data file properly?
Do you know null pointer?
What are loops in c?
What is switch in c?
Why & is used in scanf in c?
Write the program that calculates and prints the average of several integers. Assume that the last value read is sentinel 9999.
Is c is a high level language?
What is a double c?
Array is an lvalue or not?
What does main () mean in c?
What is actual argument?
Why doesnt long int work?
can we change the default calling convention in c if yes than how.........?