본문 바로가기
Language/C++ & openGL

C++기초 구구단 for while

by javapp 자바앱 2019. 1. 8.
728x90

#include <iostream>

using namespace std;

int main()

{

int x = 0, y;



while (++x&&x < 10) {

for (y = 1; y <= 9; y++) {


cout << x << "*" << y << "=" << x * y << endl;



}

}





return 0;

}

*/

#include <iostream>

using namespace std;

int main()

{

int x, y;


for (x = 2; x <= 9; x++)

{

for (y = 1; y <= 9; y++)

{

cout << x << "*" << y << "=" << x * y << endl;

}

}

return 0;

}


댓글