Jump to content
ChetanaSforum
habshola

how to solve this aptitude?wat is the ans?

Recommended Posts


Find min value of x:

 

|-5-x| + |2-x|+|6-x|+10-x|; where x is an integer

0 /17 /23 /19

 

 

GK

---------->

 

if u put x values to the equation |-5-x| + |2-x|+|6-x|+10-x|

 

x=0 then answer is 13

 

x=17 then answer is -55

 

x=23 then answer is -79

 

x=19 then answer is -63

 

 

so tha min value of x is 23.

 

if u have doubt means check the c#.net program

 

 

using System;

using System.Data;

 

protected void Button2_Click(object sender, EventArgs e)

{

string dd = TextBox1.Text;

int val = Convert.ToInt32(dd.ToString());

int get=print(val);

Label1.Text = get.ToString();

}

 

public static int print(int n)

{

int x=n;

int val=-5-x + 2-x+6-x+10-x;

return val;

}

 

 

thank u...

Share this post


Link to post
Share on other sites

GK

---------->

 

if u put x values to the equation |-5-x| + |2-x|+|6-x|+10-x|

 

x=0 then answer is 13 //////this answer is wrong becoz mod[-5]=5 so plz. check

x=17 then answer is -55

 

x=23 then answer is -79

 

x=19 then answer is -63

mod[-]=+ve plz check it again

ranju656@sify.com

Share this post


Link to post
Share on other sites

answer 0 hoga boss

answer is 19coz when you draw it on no. line and take each value of as a person then in order to meet to each other the total distance travelled by the four person is 19.And thus this is your answer

Share this post


Link to post
Share on other sites

Considering x=1

|-5-(-1)|+|2-(-1)|+|6-(-1)|+|10-(-1)|

4+1+5+9

19 . So the value of x= 19.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×