Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // hello.cpp: David Noelte
- // Description: prints the awesome "Hello World!"
- #include <iostream>
- #include <iomanip>
- using namespace std;
- int main() {
- // changes cout to left-aligned
- cout << setiosflags(ios::left);
- // this loop handles the rows
- for (int i = 0; i < 6; i++) {
- // this loop handles the columns
- for (int i = 0; i < 4; i++)
- // setw(int) sets the column with
- cout << setw(20) << "Hello World! ";
- // this ends the line in the first loop
- cout << endl;
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment