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 are the advantages and disadvantages of pointers?
What is s or c?
Why do we use int main?
What is structure padding in c?
What is difference between stdio h and conio h?
Which is not valid in C a) class aClass{public:int x;}; b) /* A comment */ c) char x=12;
Some coders debug their programs by placing comment symbols on some codes instead of deleting it. How does this aid in debugging?
Do you have any idea about the use of "auto" keyword?
how to introdu5ce my self in serco
please give me a VIRTUSA sample palcement papers.... you will only send TECHNICAL SECTION..... that is help for me Advance Thanks........................
List some basic data types in c?
What are register variables in c?
hi send me sample aptitude papers of cts?
Write a program to identify if a given binary tree is balanced or not.
swap 2 numbers without using third variable?