Hi, so im new to this website. I am trying to write a program that tells you if a number is prime, but i have an error message that keeps popping up saying :
error C2447: '{' : missing function header (old-style formal list?
Here is my code:
#include <stdio.h>
#include "genlib.h"
int main();
{
int n,d;
n= GetInteger();
d=0;
for(int i=1;i<=n;i++)
{
if(n%i==0)d++;
}
if(d==2) printf("The number is prime");
else printf("The number is not prime");
}
Thanks :)