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
When do we get logical errors?
When should you not use a type cast?
What is data types?
How do you use a 'Local Block'?
Why shouldn’t I start variable names with underscores?
Write a C program linear.c that creates a sequence of
processes with a given length. By
sequence it is meant that each created process has exactly
one child.
Let's look at some example outputs for the program.
Here the entire process sequence consists of process 18181:
Sara@dell:~/OSSS$ ./linear 1
Creating process sequence of length 1.
18181 begins the sequence.
An example for a sequence of length three:
Sara@dell:~/OSSS$ ./linear 3
Creating process sequence of length 3.
18233 begins the sequence.
18234 is child of 18233
18235 is child of 18234
........ this is coad .... BUt i could not compleate it .....:(
#include
Is void a keyword in c?
Explain the properties of union. What is the size of a union variable
Write a program to print numbers from 1 to 100 without using loop in c?
PROGRAM TO WRITE CONTENTS OF 1 FILE IN REVERSE TO ANOTHER FILE,PROGRAM TO COPY 1 FILE TO ANOTHER BY SPECIFYING FILE NAMES AS COMMAND LINE
What is c programing language?
In C language what is a 'dangling pointer'?
What do you understand by friend-functions? How are they used?
What is the explanation for prototype function in c?
What is the use of pragma in embedded c?