#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;
}
}
}
Start print "the sum of all even numbers is infinite" end
You don't write an algorithm for a C++ program, unless you are documenting the C++ program after-the-fact. The normal procedure is to write the algorithm first, in a language independent fashion, and then translate that stated algorithm into C++ code, or into whatever language you wish.
To find the median of a set of numbers write them in order, then: * if there are an odd number of numbers then the median is the number in the middle * otherwise there are an even number of numbers and the median is the mean average of the two numbers in the middle. With 4 numbers there is an even number of numbers, so the median is the mean average of the 2nd and 3rd numbers when they are sorted into order. Example: Find median of {3, 9, 4, 5} Ordered → {3, 4, 5, 9} → median = mean_average(4, 5) = (4 + 5) ÷ 2 = 4.5
If it's the number of tons, you write: ' 1 ' If it's the number of pounds, you write: ' 2,000 ' If it's the number of ounces, you write: ' 32,000 '
As a number it is: 1,216,000
You can write out this algorithm. This will then be programmed into the device to make determining prime numbers easier.
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
maybe
please give me an algorithm and a corresponding flow chart that displays list of numbers from 1 to 20.
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.
jgfujtf
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.
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.
Start print "the sum of all even numbers is infinite" end
theory part to how u can insert element at middle of link list ?
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.
read num1 read num2 sum = num1 num2 print highest value