"In function int main()"

PLease, what is the error?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
  
#include<iostream>
#include<math.h>
#include<stdlib.h>

using namespace std;


bool Prime (int st2)
{
    bool answer = true;                       
   
    for (int i = 2; i < st2; i++)
        if (st2 % i == 0)
        {
            cout <<"Najmanjši pradivizor je  " <<i << endl<<endl;
            cout<<endl<<endl<<endl;   
            answer = false;     
            break;            
        }
    return answer;
}

int main(){
   
   
int st2;
int st=rand();
cout<<"Testing next random number: "<<st<<endl;

cout<<endl<<endl;
if (st<=1){ cout<<"This number is not prime.";
break;
}
double st1=sqrt(st);
st2=(int)st1;
cout<<"Sqrt of thsi number is:"<<st1<<endl;

cout<<endl<<endl<<endl;
Last edited on
No closing brace on your main function.
I have it, but later, cause program is calculating stil lsome things...
Topic archived. No new replies allowed.