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

Answers were Sorted based on User's Feedback



what is y value of the code if input x=10 y=5; if (x==10) else if(x==9) elae y=8; ..

Answer / varun

the value of y is not changing so i think y wll reamin 5.

Is This Answer Correct ?    18 Yes 1 No

what is y value of the code if input x=10 y=5; if (x==10) else if(x==9) elae y=8; ..

Answer / prakash

I'm getting "error C2181: illegal else without matching if".
If that is corrected then the output will be y = 5.

Is This Answer Correct ?    5 Yes 0 No

what is y value of the code if input x=10 y=5; if (x==10) else if(x==9) elae y=8; ..

Answer / rahul

8

Is This Answer Correct ?    8 Yes 7 No

what is y value of the code if input x=10 y=5; if (x==10) else if(x==9) elae y=8; ..

Answer / 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

More C Interview Questions

What is context in c?

0 Answers  


What are the general description for loop statement and available loop types in c?

0 Answers  


List some basic data types in c?

0 Answers  


Can you write the function prototype, definition and mention the other requirements.

0 Answers   Adobe,


How is a structure member accessed?

0 Answers  






how many header file is in C language ?

44 Answers   College School Exams Tests, CTS, IBM, IMS, Infosys, ME, Sign Solutions, Wipro, XVT,


how to compare two strings without using strcmp() function??

1 Answers  


What is the use of structure padding in c?

0 Answers  


What are reserved words?

0 Answers  


N O S I E R + A S T R A L ---------------- 7 2 5 6 1 3

3 Answers   Honeywell,


Explain the difference between structs and unions in c?

0 Answers  


why ordinary variable store the later value not the initial

1 Answers  


Categories