Your formatting is terrible and makes it difficult to follow. Here is the same program reformatted the way it should be formatted. Note that it is very easy to spot mis-matched braces when formatted this way. Also, don't mix using tabs and spaces because they will get screwed up when you post it here.
#include<iostream>
using namespace std;
int main()
{
int n,i=3;
cout<<"please enter number to see weither it is a prime one or not"<<endl;
cin>>n;
if(n==2||n==3)
{
cout<<n<<"is prime number"<<endl;
}
else if(n%2==0)
{
cout<<n<<"\t is not prime"<<endl;
}
else
{
for(i=3;i<n;i+=2)
{
if(n%i==0)
{
cout<<n<<"\t is not a prime number"<<endl;break;
}
else if (i=n-1)
{
cout<<n<<"is a prime number"<<endl;
}
}
}
return 0;
} Ancient Dragon
Retired & Loving It
Team Colleague
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343