Easier View

Very sorry, The posts are all mixed-up . View blog archieve to start learning =D

About Me

My name is Luke Chin. Here to teach you guys how to code C++

Thursday, April 12, 2007

Doing mathematics in C++

#include

int main()
{
int num1,product,num2;


std::cout << "enter integer 1 :"; std::cin >> num1;
std::cout << "enter integer 2 :"; std::cin >> num2;
product = num1 * num2;
std::cout << product;
system("pause");
return 0;
}


-do you understand what this code does? it asks the user for 2 numbers and multiplies them
and prints the product to the screen.

sign meaning
+ addition
- subtraction
++ increment +1
-- decrement -1
/ divide
* multiplication
% mudulus // returns the remainder

No comments: