#include <iostream>
using namespace std;
int main()
{
int num, i;
cout << "\n\n";
cout << "====================== MULTIPLES OF A NUMBER ======================";
cout << endl << "Input a number: ";
cin >> num;
cout << "\t\tThese are the first 100 multiples of " << num <<endl;
for (int i = 1; i <= 100; i++)
{
cout << i * num << "\t";
if ((i * num) % (num*10) == 0)
{
cout << endl;
}
}
getchar();
}
#include <iostream>
using namespace std;
int main()
{
int num, i;
cout << "\n\n";
cout << "====================== MULTIPLES OF A NUMBER ======================";
cout << endl << "Input a number: ";
cin >> num;
cout << "\t\tThese are the first 100 multiples of " << num <<endl;
for (int i = 1; i <= 100; i++)
{
cout << i * num << "\t";
if ((i * num) % 20 == 0)
{
cout << endl;
}
}
getchar();
}
Yung gusto sana ng prof namin 10x10 lahat ng output. pag nag insert ako ng ibang number ibang layout ulit sya.Gumagana yung code mo dinagdagan ko lang, "modulus" yata yun tawag dun
C++:#include <iostream> using namespace std; int main() { int num, i; cout << "\n\n"; cout << "====================== MULTIPLES OF A NUMBER ======================"; cout << endl << "Input a number: "; cin >> num; cout << "\t\tThese are the first 100 multiples of " << num <<endl; for (int i = 1; i <= 100; i++) { cout << i * num << "\t"; if ((i * num) % 20 == 0) { cout << endl; } } getchar(); }
#include <iostream>
using namespace std;
int main()
{
int num, i;
cout << "\n\n";
cout << "====================== MULTIPLES OF A NUMBER ======================";
cout << endl << "Input a number: ";
cin >> num;
cout << "\t\tThese are the first 100 multiples of " << num <<endl;
for (int i = 1; i <= 100; i++)
{
cout << i * num << "\t";
if ((i * num) % (num*10) == 0)
{
cout << endl;
}
}
getchar();
}