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

How was c created?

1064


What are type modifiers in c?

1054


What is difference between static and global variable in c?

1055


Why main is not a keyword in c?

1255


What are the two types of structure?

1087


Can you assign a different address to an array tag?

1169


What is indirection? How many levels of pointers can you have?

1141


How will you declare an array of three function pointers where each function receives two ints and returns a float?

1364


What is the stack in c?

1151


What is the use of define in c?

1064


write a program to display all prime numbers

1972


What is echo in c programming?

1029


Which is not valid in C a) class aClass{public:int x;}; b) /* A comment */ c) char x=12;

1074


How will you write a code for accessing the length of an array without assigning it to another variable?

1046


What is the difference between NULL and NUL?

1290