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 process of writing the null pointer?
write a c program to find the largest and 2nd largest numbers from the given n numbers without using arrays
What is main () in c?
Why is c used in embedded systems?
main use of recursive function a) processing speed high b) reduce program length/reduce repeated statements c) if you do not, use iterative methods like, for, while or do-while d) all the above
How can you increase the size of a statically allocated array?
Do you know the difference between exit() and _exit() function in c?
What does a derived class inherit from a base class a) Only the Public members of the base class b) Only the Protected members of the base class c) Both the Public and the Protected members of the base class d) .c file
How can you return multiple values from a function?
Explain b+ tree?
What is difference between %d and %i in c?
write a program to reverse a every alternetive words in a string in a place. EX: Input is "this is the line of text" Output should be "shit is eht line fo text" Please any one tell me code for that.
Explain which function in c can be used to append a string to another string?
Do array subscripts always start with zero?
How can I manipulate strings of multibyte characters?