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
What is a macro?
write a C program: To recognize date of any format even formats like "feb-02-2003","02-february-2003",mm/dd/yy, dd/mm/yy and display it as mm/dd/yy.
What type is sizeof?
Hai what is the different types of versions and their differences
What is the difference between struct and union in C?
Describe the difference between = and == symbols in c programming?
Write a program to print all permutations of a given string.
What is the code in while loop that returns the output of given code?
What do you understand by friend-functions? How are they used?
What is selection sort in c?
please can any one suggest me best useful video tutorials on c i am science graduate.please help me.u can email me to sas29@in.com
What is the main difference between calloc () and malloc ()?
What are the different data types in C?
What is a shell structure examples?
What is the difference between typedef struct and struct?