answersLogoWhite

0


Best Answer

When you find the median you are trying to find the middle of a set of numbers. If you line the numbers up in numerical order and count one off on each side multiple times, you will get to the middle. However, if you have only two numbers or two numbers in the middle, you would add those two numbers together and then divide by two.

For example:

2, 4, 14, 27, 65, 83

First, you would count off 2 and 83 then 4 and 65. You would be left with 14 and 27 in the middle. You would add 14 and 27 to get 41. Then, you would divide 41 by two to get 20.5 which would be your median.

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you find the median when you have two int?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you find the median if there isn't a median?

You add the two numbers in the middle of your range and then you divide them by two, or just find the number that is halfway between the two numbers, and you then have your median.


Write a c program to print mean median and mode?

#include<stdio.h> #define MAXVAL 1000 void sort1(int a[],int n); void median(int a[],int n); void mode(int a[],int n); int main() { int n; int arr[MAXVAL]; int i; printf("Enter the number of elements:"); scanf("%d",&n); printf("Enter the values:"); for(i=0;i<n;i++) { printf("a[%d]=",i); scanf("%d",&arr[i]); } sort1(arr,n); median(arr,n); mode(arr,n); } void sort1(int a[],int n) { int i; int j; int temp; for(i=0;i<n;i++) { for(j=i;j<n;j++) { if(a[i]>a[j]) { temp=a[i]; a[i]=a[j]; a[j]=temp; } } } } void median(int a[],int n) { int median; int mid; if((n%2)==0) { mid=n/2; median=(a[mid-1]+a[mid])/2; } else { mid=(n+1)/2; median=a[mid-1]; } printf("The median is:%d\n",median); } void mode(int a[],int n) { int i; int count1[MAXVAL]; for(i=0;i<n;i++) { count1[i]=0; } for(i=0;i<n;i++) { count1[a[i]]++; } i--; int mode=count1[0]; int j; int k; int flag=0; for(j=0;j<=a[i];j++) { if(count1[j]>count1[mode]) mode=j; } for(j=0;j<=a[i];j++) { for(k=j+1;k<=a[i];k++) { if(count1[j]=count1[k] && count1[j]>count1[mode]) { flag=1; } } } if(flag==1) { printf("Mode cannot be calculated"); } else printf("the Mode is:%d",mode); }


Write a program to find median of n numbers?

import java.util.Arrays; class Solution { public int median(int[] A) { int[] b = new int[A.length]; System.arraycopy(A, 0, b, 0, b.length); Arrays.sort(b); if (A.length % 2 == 0) { return b[b.length / 2]; } else { return (int) ((b[(b.length / 2) - 1] + b[b.length / 2]) / 2.0); } } }


What do you do when your trying to find the median of two numbers?

if you are trying to find the median and there is two middle numbers, you add the two Numbers together and divide is by two.


How do you find the median when there are 6 numbers?

you find the two numbers in the middle and add them. divide the sum by two. that's the median.


What happens to the median when you come up with two answer?

when you have an even amount of numbers while trying to find the median, you first find the two numbers that are at the median and then take all the numbers between them and find the median of that. if that amount of digits is also even, then you must have a decimal median.


How do you find out a median when there is only two numbers left?

If you need to find a median between two numbers, pick one of them arbitrarily.


How do you find the median with two numbers?

To find the median with two numbers, do as you would to find the "average" or the "mean" by finding the sum between the two numbers and dividing the sum (or total) by two.


How do you find the median when two numbers are in the middle?

If the two numbers are that same in the middle than the median is that number.However if the two numbers are different then you just find the average of those two numbers.


How to find the missing number if median is given?

The median is the middle number. If there is an odd number of numbers in the set, the median is the middle number, and the only way to find the missing number is if the median is the missing number. If there is an even number of numbers in the set, the median is the average of the two middle numbers, and the only way to find the missing number is if the median is one of those two numbers. If it is, you can take the median and the one of the two numbers you know. Use the formula (# +#)/2=median and solve.


How do you find median with 6 numbers?

take the two middle numbers and find the sum. then take half and that's your median.


How do you find the median in a histogram?

i think you divide the histogram in two, so there are two equal halves. The number in the middle is the median,