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
program to convert a integer to string in c language'
What are predefined functions in c?
What is a structure in c language. how to initialise a structure in c?
Describe the difference between = and == symbols in c programming?
Is a house a mass structure?
What is c programming structure?
difference between object file and executable file
What is header file in c?
What is the use of extern in c?
difference between Low, Middle, High Level languages in c ?
What is the difference between memcpy and memmove?
number of times a digit is present in a number
Explain a pre-processor and its advantages.
What does the c in ctime mean?
What is a double c?