What is the value of y in the following code?
x=7;y=0;
if(x=6)
y=7;
else
y=1;
Answer Posted / piyush
its looks logically incorrect,but in c anc c++ if any such
incident occurs like if(x=6), this condition is always
treated as true
will give a warning ,but will execute this as considering
the if condition as true
ANSWER to this question is y=7
Is This Answer Correct ? | 15 Yes | 0 No |
Post New Answer View All Answers
What is New modifiers?
int i=10; printf("%d %d %d", i, i=20, i);
Explain setjmp()?
What is the difference between formatted&unformatted i/o functions?
How can I ensure that integer arithmetic doesnt overflow?
Once I have used freopen, how can I get the original stdout (or stdin) back?
Write a program to reverse a string.
Explain how do I determine whether a character is numeric, alphabetic, and so on?
How can I find the modification date and time of a file?
‘SAVEPOINT’ and ‘ROLLBACK’ is used in oracle database to secure the data comment. Give suitable examples of each with sql command.
Explain how do you determine the length of a string value that was stored in a variable?
What are header files in c programming?
What are disadvantages of C language.
How to write a program for machine which is connected with server for that server automatically wants to catch the time for user of that machine?
How can I insert or delete a line (or record) in the middle of a file?