C++: Learning the Basics – Multiplying three numbers

Situation: User can insert three numbers and the program displays their product!

Code:

#include 
#include 
void main()

{         

clrscr();

int num1, num2, num3, product;

cout<>num1

cout<>num2

cout<>num3

product=num1*num2*num3;

cout<<”\n\t Product of the three numbers: “ <<product;

}

Interactive video to learn the code and see how it runs:

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s