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 / rakhi

b) Fail 1 Fail 2

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a far pointer in c?

1038


What is meant by realloc()?

1134


1234554321 1234 4321 123 321 12 21 1 1 12 21 123 321 1234 4321 1234554321

3709


When should you use a type cast?

1117


what is the diffrenet bettwen HTTP and internet protocol

1832


a program that can input number of records and can view it again the record

1903


What is the difference between fread and fwrite function?

1077


What are the main characteristics of c language describe the structure of ac program?

1208


Does sprintf put null character?

1035


How many keywords are there in c?

1074


What does do in c?

1037


State two uses of pointers in C?

1050


How many levels deep can include files be nested?

1138


if p is a string contained in a string?

1839


Explain what is the difference between far and near ?

1101