adspace


What is the value of y in the following code?
x=7;y=0;
if(x=6)
y=7;
else
y=1;

Answer Posted / balaji jayakumar

y=7 because if condition doesnt fail... so the immediate
statement after if will be executed and 7 gets printed. It
is quite certain only if "if" fails else will be be opted
for. so y=7... no error statements will occur.. i have tried
it in c.

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

swap 2 numbers without using third variable?

1217


what is ur strangth & weekness

2598


write a c program to find the sum of five entered numbers using an array named number

2265


Do you know the difference between malloc() and calloc() function?

1144


hi send me sample aptitude papers of cts?

2258


what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;

2522


write a progrmm in c language take user interface generate table using for loop?

2129


what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;

2743


How do you determine the length of a string value that was stored in a variable?

1209


hi folks i m approching for h1 b interview on monday 8th of august at montreal and i m having little problem in my approval notice abt my bithdate my employer has made a mistake while applying it is 12th january and istead of that he had done 18 the of january do any body have any solution for that if yes how can i prove my visa officer abt my real birthdate it urgent please let me know guys thaks dipesh patel

1947


Explain the difference between null pointer and void pointer.

1165


The % symbol has a special use in a printf statement. How would you place this character as part of the output on the screen?

1364


`write a program to display the recomended action depends on a color of trafic light using nested if statments

2218


What is variable initialization and why is it important?

1404


What are compound statements?

1301