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

Is null always defined as 0(zero)?

1068


Write a program to produce the following output: 1 2 3 4 5 6 7 8 9 10

15755


Explain about the functions strcat() and strcmp()?

1011


What are formal parameters?

1080


Explain how do you override a defined macro?

1035


What is the difference between constant pointer and constant variable?

1187


What is the use of #include in c?

1047


What is difference between structure and union in c programming?

1048


What are enumerated types?

1133


Write a program to use switch statement.

1095


What are the two types of functions in c?

966


differentiate built-in functions and user – defined functions.

1054


What is infinite loop?

1052


What is an endless loop?

1249


Explain how does flowchart help in writing a program?

1078