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

Is printf a keyword?

1165


Why is it that not all header files are declared in every C program?

1163


How pointer is different from array?

1030


What is array within structure?

1080


What is a substring in c?

1011


what is the difference between class and unio?

2321


How can I manipulate individual bits?

1003


What are the 5 data types?

1079


Is it valid to address one element beyond the end of an array?

1141


What is the default value of local and global variables in c?

1000


Can a function argument have default value?

1112


What are the preprocessor categories?

1014


What are identifiers in c?

1163


Differentiate between new and malloc(), delete and free() ?

1150


What is the difference between array and linked list in c?

1104