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 is the value of y in the following code?
x=7;y=0;
if(x=6)
y=7;
else
y=1;

Answer Posted / piyush

its looks logically incorrect,but in c anc c++ if any such
incident occurs like if(x=6), this condition is always
treated as true

will give a warning ,but will execute this as considering
the if condition as true

ANSWER to this question is y=7

Is This Answer Correct ?    15 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between variable declaration and variable definition in c?

1014


What are different types of operators?

990


What is pass by value in c?

1000


which is conditional construct a) if statement b) switch statement c) while/for d) goto

1163


When c language was developed?

1010


Compare array data type to pointer data type

966


write a program to generate address labels using structures?

4517


What is the sizeof () operator?

1012


What is clrscr in c?

1070


What is sizeof c?

1001


Is stack a keyword in c?

1037


What is difference between static and global variable in c?

979


Does c have class?

1050


Where are c variables stored in memory?

1022


What is struct node in c?

1018