Let me start off by saying that I am new to programming in C++. I know this may be basic but can someone help me in telling me what I am doing wrong with this code?
#include "conio.h"
#include <iostream>
#include <cmath>
#include <stdio.h>
using namespace std;
int main()
{
double n;
double d;
double y;
double fmod;
for (n = 3; n <=100; n++)
{for (d = (n - 1); d>=2; d--);
fmod(n,d);}
cout<<n<<"is not prime";
if (fmod=0)
cout<<n<<"is not prime";
else
cout<<n<<"is prime"<<endl;
return 0;
}
#include "conio.h"
#include <iostream>
#include <cmath>
#include <stdio.h>
using namespace std;
int main()
{
double n;
double d;
double y;
double fmod;
for (n = 3; n <=100; n++)
{for (d = (n - 1); d>=2; d--);
fmod(n,d);}
cout<<n<<"is not prime";
if (fmod=0)
cout<<n<<"is not prime";
else
cout<<n<<"is prime"<<endl;
return 0;
}
Comment