
 int main()
 {
     int num, i, j;
     cout<<"Enter an Integer:"<<endl;
                  cin>>num;
                  
                  for(i=0; i<=num; i++)
                  {
                           for(j=2; j<=i; j++)
                           {
                                    if(i%j == 0)
                                    {
                                    break;
                                    }
                                    else if (i == j+1)
                                    {
                                     cout<<i<<endl;    
                                         }
                                    }
                           }
    
}
              