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

What is meant by high-order and low-order bytes?

640


What are extern variables in c?

538


What is zero based addressing?

699


What is c++ used for today?

650


What is the difference between procedural and declarative language?

637






Explain 'far' and 'near' pointers in c.

693


How can you draw circles in C?

612


What is the difference between pure virtual function and virtual function?

641


Write a program to find factorial of a number using recursive function.

632


For what purpose null pointer used?

600


What is use of pointer?

577


What are predefined functions in c?

558


Is there sort function in c?

569


void main(int n) { if(n==0) return; main(--n); printf("%d ",n); getch(); } how it work and what will be its output...............it any one know ans plz reply

2208


How can I pad a string to a known length?

603