GeekInterview.com
Series: Subject: Topic:
Question: 195 of 238

Read the function conv() given below
conv(int t)
{
int u;
u=5/9 * (t-32);
return(u);
                            }
What is returned

A. 15
B.  0
C. 16.1
D. 29

This question is related to TCS Interview
Asked by: Interview Candidate | Asked on: Jun 6th, 2005
Showing Answers 1 - 4 of 4 Answers
Pallavi

Answered On : Jun 6th, 2006

0 will be returned, because division of two integers (5/9)  is 0.

Yes  1 User has rated as useful.
  
Login to rate this answer.
SUVI_1990

Answered On : Jun 13th, 2009

View all answers by SUVI_1990

0 is the answer
The division of 5/9 is 0.5
Then 0.5*(t-32) is -31.5
So roundup of this is 0.

  
Login to rate this answer.
rajesh

Answered On : Aug 5th, 2011

absolutely its 0... coz u is declared as int.. so u=0.5.. so it take u as 0.. and anything*0 becomes zero..

  
Login to rate this answer.
bhanupriya

Answered On : Jan 17th, 2012

Ans. is B. 0

Code
  1. conv(int t){ int u; u=5/9 * (t-32); return(u); }

  
Login to rate this answer.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.