Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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 variable declaration and definition in c?

0 Answers  


How are portions of a program disabled in demo versions?

0 Answers  


What is difference between Structure and Unions?

0 Answers   TISL,


Hi Every one......... Please Any body give me the answer for my question. Is it possible to print the word "PRINT F", without using printf() statement in C-Language.

4 Answers  


what is the function of pragma directive in c?

0 Answers  


Write c-code for 5+55+555+5555+55555+555555+5555555. Output will be it's answer...

4 Answers   TCS,


1 1 1 1 2 1 1 3 3 1 1 4 6 4 1

1 Answers  


why we are using semicolon at the end of printh statment

2 Answers   HCL,


Write a program in c to input a 5 digit number and print it in words.

11 Answers  


what is the size of an integer variable?

4 Answers  


a program that can input number of records and can view it again the record

0 Answers   Accenture,


diff. between *p and **p

3 Answers  


Categories