Respuesta :
Answer:
if(i > j && i > k) // check if i is greatest
{
biggest = i;
}
else if( j> i && j > k) // check j is greatest
{
biggest = j;
}
// else highest is k
else // otherwise k is greatest
{
biggest = k;
}
Explanation:
Following are the program in c++ language
#include<iostream> // header file
using namespace std; // namespace
int main() // main function
{
int i,j,k;// varaible declaration
int biggest;
cout<<" \nenter the value i,j and k:\n ";
cin>>i>>j>>k;
if(i > j && i > k) // check if i is greatest
{
biggest = i;
}
else if( j> i && j > k) // check j is greatest
{
biggest = j;
}
// else highest is k
else // otherwise k is greatest
{
biggest = k;
}
cout<<" the biggest number is :"<<biggest;
return(0);
}
Output:
enter the value i,j and k:
67
8
9
the biggest number is :67
In this program we check the following condition:
if(i > j && i > k) then it store the value of i into biggest variable .
if( j> i && j > k) then it store the value of j into biggest variable .
otherwise the value of k is store into biggest variable .