Hey guys, I am a new c++ programmer, and I created this program to factor numbers and tell u if they are prime. However, I would like to make it so that it does not repeat factors. For example, for 10, I don't want it to say:
Factors:
5,2
2,5
Thank you, heres the code.
#include <iostream>
using namespace std;
int main (int argc, const char * argv[])
{
while(1==1){
float x;
cout<<"Enter a number to see if it is prime"<<endl;
cin>>x;
int test=0;
int half=x/2;
for(float y=2; y<x; y++){