Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F102891884
ch-01-ex-02-solution.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Tue, Feb 25, 06:31
Size
690 B
Mime Type
text/x-c
Expires
Thu, Feb 27, 06:31 (2 d)
Engine
blob
Format
Raw Data
Handle
24450542
Attached To
R1106 Programming Concept Rouaze
ch-01-ex-02-solution.cpp
View Options
/*
* exercise-02.cpp
*
* Read two integers from the keyboard and write their product on the screen.
*
* Created on: Jul 26, 2012
* Author: Radu Popescu <radu.popescu@epfl.ch>
*/
#include <iostream>
int main(int argc, char* argv[])
{
// Read the two numbers from the keyboard
std::cout << "Please input the first number. a= ";
// Declare an integer variable and read a value from the keyboard
int a;
std::cin >> a;
std::cout << "Please input the second number. b= ";
// Same thing for the second number
int b;
std::cin >> b;
// Compute and print the product;
std::cout << "The product of " << a << " and " << b << " is: "
<< a * b << std::endl;
return 0;
}
Event Timeline
Log In to Comment