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 / reepal
e) syntex error during compilation
| Is This Answer Correct ? | 3 Yes | 1 No |
Post New Answer View All Answers
how many errors in c explain deply
What is c language used for?
hi, which software companys will take,if d candidate's % is jst 55%?
#define MAX(x,y) (x) >(y)?(x):(y) main() { inti=10,j=5,k=0; k= MAX(i++,++j); printf("%d..%d..%d",i,j,k); }
What are pointers? What are stacks and queues?
Is int a keyword in c?
Program to find the sum of digits of a given number until the sum becomes a single digit. (e.g. 12345=>1+2+3+4+5=15=>1+5=6)
What are dangling pointers? How are dangling pointers different from memory leaks?
What is the use of volatile?
how can f be used for both float and double arguments in printf? Are not they different types?
What is abstract data structure in c?
What are the key features in c programming language?
How to explain the final year project as a fresher please answer with sample project
Why is c called "mother" language?
What is getch() function?