C++ Programming Ch.2 Exercise 2 Solution

Problem: cout과 << 연산자를 이용하여 다음과 같이 구구단을 출력하는 프로그램을 작성하라. Objective & Hints: cout 활용, 화면 출력 Execution Result: Code: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 #include using namespace std; int main() { int i, j; for(i=1; i<10; i++){ for(j=1; j<10; j++) { cout << j << "x" << i << "=" << j*i << '\t'; if(j==9) // 9단 출력 후 줄바꿈. cout << endl; } } return 0; } Explanation: ...

February 28, 2020 · 1 min · Sobamemil