Currently, I'm attempting to output the factors of a number in a grid format as opposed to just a direct line of numbers.
I am trying to use a for loop to accomplish this, however, i'm having a difficult time deducting a formula to create this.
Any input on how to make the output into a grid would be awesome. Thanks.
Code:for(i=1;i<=n;i++) { if(n%i==0) cout << n/i <<endl; }