Find Biggest of 2 Numbers: C++
Video tutorial to find the biggest of the two integer numbers in C++, using if-else control statements.
Full Source Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | #include<iostream .h>
#include<conio .h>
void main()
{
int a, b;
clrscr();
cout< <"Enter 2 numbers\n";
cin>>a>>b;
int big;
if( a > b )
big = a;
else
big = b;
cout< <endl<<"Among "<<a<<" and "<<b<<" biggest is "<<big;
getch();
} |
In this program we get two integer variables from the user.
If value of variable a is bigger, then we store it inside the variable big; else we store the value of variable b inside variable big.
Finally display the value of variable big which contains the biggest number amongst the two values entered by the user.
Video Tutorial: Biggest of 2 Integer Numbers
YouTube Link: http://www.youtube.com/watch?v=awbq2gsDg3E [Watch the Video In Full Screen.]
Output
Enter 2 numbers
-100
0
Among -100 and 0 biggest is 0
Related posts:
- Addition of 2 Numbers: C++
- Object Oriented Programming: C++
- Using Constructors & Member Function to add two numbers: Java
- Simple Interest: C Program
Get FREE blog updates to your email inbox. Enter your email ID and subscribe:
Start Making Money From Your Programming Skills
- Subscribe to Technotip.com blog update and you will be able to download "Tips, Tricks and Strategies to Make Money Online" eBook for free.
- You will also receive tips to improve your programming skills, and strategies to make money from your programming skills. We will also send useful resources for learning and building your application.
- You can also make money with us, by just recommending our website to your friends and family. You will get complete strategy for making $300 and more in the ebook that we will send you - once you subscribe to our free blog update using the below form..


Leave a Reply