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

Ans: 7

Coz all non-zero statements are treated as true.
code can be written as..

if(TRUE)/*x=6 is a non-zero*/
Y=7;
else
y=1;

Note: To compare,have to use '==' operator.'=' is an
assignment operator.

Is This Answer Correct ?    12 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is int main () in c?

1027


What is malloc return c?

976


What are valid operations on pointers?

1149


What is the size of enum in bytes?

1036


Explain what are bus errors, memory faults, and core dumps?

1223


Tell me the use of bit field in c language?

1016


What are pointers?

1044


What is the time and space complexities of merge sort and when is it preferred over quick sort?

1013


how to write optimum code to divide a 50 digit number with a 25 digit number??

3203


which type of aspect you want from the student.

2114


Why is c not oop?

928


how many key words availabel in c a) 28 b) 31 c) 32

1010


Why do we use namespace feature?

1008


What is the difference between the expression “++a” and “a++”?

1159


What is meant by errors and debugging?

1055