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

c)Pass 1, Fail 2

Is This Answer Correct ?    1 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between scanf and fscanf?

1199


Write a program to find the biggest number of three numbers in c?

1005


Differentiate between full, complete & perfect binary trees.

1052


List some of the dynamic data structures in C?

1192


What is the explanation for cyclic nature of data types in c?

1140


How can I use a preprocessorif expression to ?

998


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

1065


What is #define?

1039


What is static memory allocation? Explain

1033


what is stack , heap ,code segment,and data segment

2634


the portion of a computer program within which the definition of the variable remains unchanged a) mode b) module c) scope d) none

1000


What are header files and explain what are its uses in c programming?

1065


Can you please compare array with pointer?

1031


What does a pointer variable always consist of?

1042


How do shell structures work?

1069