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
Is there anything like an ifdef for typedefs?
What is use of pointer?
The program will first compute the tax you owe based on your income. User is prompted to enter income. Program will compute the total amount of tax owed based on the following: Income Tax 0 - $45,000 = 0.15 x income $45,001 - $90,000 = 6750 + 0.20 x (income – 45000) $90,001 - $140,000 = 15750 + 0.26 x (income – 90000) $140,001 - $200,000 = 28750 + 0.29 x (income – 140000) Greater than $200,000 = 46150 + 0.33 x (income – 200000) Dollar amounts should be in dollars and cents (float point numbers with two decimals shown). Tax is displayed on the screen.
in programming languages a statement or part of a statement that specifies several different execution sequences a) constructs b) distructs c) executes d) none
Is int a keyword in c?
How can I use a preprocessorif expression to ?
How can I find out the size of a file, prior to reading it in?
What is hashing in c?
which of the following statement is wrong a) mes=123.56; b) con='T'*'A'; c) this='T'*20; d) 3+a=b;
How pointers are declared?
Write a program to swap two numbers without using third variable?
which type of aspect you want from the student.
How reliable are floating-point comparisons?
Q.1 write aprogram to stack using linklist o insert 40 items? Q.2 write a program to implement circular queue with help of linklist?
What is the difference between struct and union in C?