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
c)Pass 1, Fail 2
| Is This Answer Correct ? | 1 Yes | 2 No |
Post New Answer View All Answers
Explain what is a static function?
provide an example of the Group by clause, when would you use this clause
Write a program to find the biggest number of three numbers in c?
int i=3; this declaration tells the C compiler to a) reserve space in memory to hold the integer value b) associate the name i with this memory location c) store the value 3 at this location d) all the above
Explain what is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?
What is integer constants?
What is indirection?
Explain how can you determine the size of an allocated portion of memory?
How can I access an I o board directly?
Does c have class?
What is the difference between local variable and global variable in c?
can any one tel me wt is the question pattern for NIC exam
Can we use any name in place of argv and argc as command line arguments?
What is time null in c?
What is the meaning of typedef struct in c?