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
Can two or more operators such as and be combined in a single line of program code?
What are disadvantages of C language.
What is a substring in c?
What is a MAC Address?
If null and 0 are equivalent as null pointer constants, which should I use?
Why is c called c not d or e?
Explain what is wrong with this program statement?
What is the role of && operator in a program code?
What is difference between structure and union with example?
What are high level languages like C and FORTRAN also known as?
What is the use of #include in c?
Why main function is special give two reasons?
What is the best organizational structure?
Explain data types & how many data types supported by c?
What is an endless loop?