/ Published in: C++
input a number, and the program will factor it. (has not been tested, may be buggy.)
Expand |
Embed | Plain Text
#include <iostream> #include <cstdlib> #include <stdio.h> using namespace std; int main() { int i, j; cout << "*-------------------------*" << endl; cout << "| number factorer program |" << endl; //center the title box (to look better) cout << "*-------------------------*" << endl; cin >> i; if (i >= 1) { cout << i << " is divisible by:" << endl; for(j=1;j!=i;j++); if (j%i=0) { cout << j << endl; } } system("pause"); }
You need to login to post a comment.
