Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

a) Pass 1, Pass 2

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which built-in library function can be used to match a patter from the string?

1269


Explain how do you determine whether to use a stream function or a low-level function?

1048


How can you avoid including a header more than once?

948


Explain the difference between strcpy() and memcpy() function?

964


What is use of #include in c?

1124


Explain what is the benefit of using enum to declare a constant?

1047


Multiply an Integer Number by 2 Without Using Multiplication Operator

739


Write a C++ program to generate 10 integer numbers between - 1000 and 1000, then store the summation of the odd positive numbers in variable call it sum_pos, then find the maximum digit in this variable regardless of its digits length.

1968


can we implement multi-threads in c.

1107


What is spaghetti programming?

1097


Given only putchar (no sprintf, itoa, etc.) write a routine putlong that prints out an unsigned long in decimal. [ I gave the obvious solution of taking % 10 and / 10, which gives us the decimal value in reverse order. This requires an array since we need to print it out in the correct order. The interviewer wasn't too pleased and asked me to give a solution which didn't need the array ].

1072


When is a “switch” statement preferable over an “if” statement?

1113


Is it better to use malloc() or calloc()?

1086


When should you use a type cast?

1087


Why doesnt the call scanf work?

1155