Add iostream and initialization
This commit is contained in:
16
ch_1/iostream/main.cpp
Normal file
16
ch_1/iostream/main.cpp
Normal file
@@ -0,0 +1,16 @@
|
||||
#include <iostream>
|
||||
|
||||
int main() {
|
||||
std::cout << "Hello, world!\n";
|
||||
|
||||
double pi { 3.1415 };
|
||||
std::cout << "pi is approximately " << pi << std::endl;
|
||||
|
||||
std::cout << "Enter a character: ";
|
||||
char c { };
|
||||
std::cin >> c;
|
||||
|
||||
std::cout << "You entered " << c << "\n";
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user