Sample – Program to enter three integers and output the biggest integer using IF
by Nideesh C on February 8, 2011 · 0 comments
in C++
#include <iostream.h>
#include <conio.h>
int main()
{
clrscr();
int x,y,z,biggest;
cout << “Enter 3 integers : “;
cin>>x>>y>>z;
biggest=x;
if(y>biggest)
biggest=y;
if(z>biggest)
biggest=z;
cout << “The biggest integer out of the 3 integers you typed “;
cout << x << “, ” << y << ” & ” << z << ” is : ” << “\n” << biggest << “\n”;
getch();
return 0;
}
This program takes in three integers x, y and z as a screen input from the user.
It then determines the biggest integer of the three using the ‘IF’ statement.
It then outputs the biggest integer using the ‘cout’ command.
Not Satisfied ? Just search & get the result
Related posts:
- Sample – Program to enter three integers and output the biggest integer.
- Sample – Program to enter an integer and output the cube of that integer.
- Sample – Program to enter an integer and print out its successor.
- Sample – Program to enter two integers and print the quotient and remainder.
- Sample – Program to enter an integer and find out if it is even or odd.
Tagged as:
c programming examples,
c programming reference,
c tutorial,
c++ program examples,
C++ Programming,
learning c++,
Program to enter three integers and output the biggest integer using IF,
programming languages,
programming languages c,
sample c++ programs
Me, freelance system administrator having the qualification of Diploma in Electronics & Tele-communication + MCSE + CCNA + CST + 5 years of experience in IT field.
If you like This post, you can follow TheOnlineTutorials on Twitter.
Contact me Via email: support@theonlinetutorials.com
Subscribe to feed via Feed or EMAIL to receive instant updates.
Legal Disclaimer:All information found on the site is without any implied warranty of fitness for any purpose or use whatsoever. Content author/site administrator is not responsible for any loss occurred due to mistakes in this tutorial. Use this tutorial website at your own risk.