answersLogoWhite

0


Best Answer

#include<iostream.h>

#include<conio.h>

void main()

{

int a,b,c;

cout<<"enter the value of a"<<endl;

cin>>a;

cout<<"enter the value of b"<<endl;

cin>>b;

cout<<"enter the value of c"<<endl;

cin>>c;

if(a>b)

{

if(b>c)

{

cout<<"the middle number is b:"<<endl;

}

else

{

if(a>c)

{

cout<<"the middle is c:"<<endl;

}

else

{

cout<<"the middle number is b:"<<endl;

}

}

if(a<b)

{

if(b<c)

{

cout<<"the middle number is b:"<<endl;

}

else

{

if(a<c)

{

cout<<"the middle number is c:"<<endl;

}

else

{

cout<<"the middle number is a:"<<endl;

}

}

}

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write algorithm to find middle number in three numbers?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Write an algorithm to check whether a number is a prime number or not?

You can write out this algorithm. This will then be programmed into the device to make determining prime numbers easier.


How to write an algorithm that accepts five numbers and displays the sum and average of the numbers?

1.Start Algorithm 2.Enter first number 3.Enter second number 4.Enter third number 5.Enter fourth number 6.Enter fifth number 7.Add five number 8.display five number / 2 9.Display result 10.End Algorithm


Can you write an algorithm to find the beast numbers?

maybe


Write an algorithm and draw a corresponding flowchart to search a number in the given list of numbers and also display its position?

please give me an algorithm and a corresponding flow chart that displays list of numbers from 1 to 20.


What the median in math?

Write the numbers of a set in ascending order. If there is an odd number of numbers, the median is the one in the middle. If there is an even number of numbers, the median is the average of the middle two.


Write algorithm and draw flowchart to find the sum of even numbers?

jgfujtf


How can you write an algorithm for getting autoformic numbers?

Perhaps you mean an automorphic number? Loop through a series of numbers - for example, all numbers from 1 to 10,000 - and check each of the numbers, whether the condition applies. The condition in this case is that if you square the number, the last digits represent the original number.


How can I write a program to display prime numbers from 1 to 100?

Write a function that implements an algorithm that checks to see if a particular integer is prime (returning a boolean). Write a program that uses that function on each number from 1 to 100, and if true, displays that number.


Write an algorithm to print sum of all even numbers?

Start print "the sum of all even numbers is infinite" end


3 Write the algorithm of inserting an element at middle of a linked?

theory part to how u can insert element at middle of link list ?


How do you figure out the median?

Finding out the median in a set of numbers is an easy process. Write out the numbers from shortest to longest, then find the number that is directly in the middle. If two numbers are in the middle, add them and divide by two to get the median.


How to Write a psuedocode algorithm to read in three numbers and print the highest and lowest number?

read num1 read num2 sum = num1 num2 print highest value