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
What is the usage of the pointer in c?
Once I have used freopen, how can I get the original stdout (or stdin) back?
Explain the array representation of a binary tree in C.
What does %c mean in c?
What is sorting in c plus plus?
What is calloc() function?
Differentiate between a structure and a union.
What are types of structure?
Does c have enums?
What are the 5 types of organizational structures?
Write a program for finding factorial of a number.
How arrays can be passed to a user defined function
How do I create a directory? How do I remove a directory (and its contents)?
can anyone please tell about the nested interrupts?
how to build a exercise findig min number of e heap with list imlemented?