what is y value of the code if input x=10
y=5;
if (x==10)
else if(x==9)
elae y=8;
a.9
b.8
c.6
d.7
Answer Posted / vint
int main()
{
int x = 10, y = 5;
if(x==10)
else if(x==9)
else y=8;
printf("%d",y);
return 0;
}
error: expected expression before 'else'
------------
int main()
{
int x = 10, y = 5;
if(x==10) {}
else if(x==9) {}
else {y=8;}
printf("%d",y);
return 0;
}
OP: 5
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Can you return null in c?
How is a structure member accessed?
What is merge sort in c?
What is the difference between call by value and call by reference in c?
In C programming, how do you insert quote characters (‘ and “) into the output screen?
Can stdout be forced to print somewhere other than the screen?
Write a program to compute the similarity between two strings - The program should get the two strings as input - Then it will output one single number which is the percentage of similarity between the two strings
count = 0; for (i = 1;i < = 10; i++);count = count + i; Value of count after execution of the above statements will be a) 0 b) 11 c) 55 d) array
What are the 5 types of inheritance in c ++?
Create a registration form application by taking the details like username, address, phone number, email with password and confirm password (should be same as password).Ensure that the password is of 8 characters with only numbers and alphabets. Take such details for 3 users and display the details. While taking input password must appear as “****”.
What are data types in c language?
What does int main () mean?
What is a struct c#?
What is meant by operator precedence?
What is a function simple definition?