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

e) syntex error during compilation

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the use of static variable in c?

1091


I need previous papers of CSC.......plz help out by posting them.......

2298


What is signed and unsigned?

1067


What are the key features in c programming language?

1076


What's the total generic pointer type?

1055


Why c language?

1076


Can one function call another?

1114


How can you return multiple values from a function?

1118


What's the right way to use errno?

1149


How can I ensure that integer arithmetic doesnt overflow?

1173


What is the function of volatile in c language?

1135


Explain what is meant by high-order and low-order bytes?

1051


Is file a keyword in c?

935


Write a program to print "hello world" without using a semicolon?

1065


what will be the output for the following main() { printf("hi" "hello"); }

11011