#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
Max = 0For K = 1 to NIf Number(K) > Max then Max = Number(K)Next KPrint Max
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
write an algorithm and draw a flow chart to find perimeter of a square
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.
1. Design an algorithm to compute sum of the squares of n numbers?
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.
Start print "the sum of all even numbers is infinite" end
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.
Max = 0For K = 1 to NIf Number(K) > Max then Max = Number(K)Next KPrint Max
theory part to how u can insert element at middle of link list ?