QUOTE
if ( n < 0)
num_less=n;
cout<<"this is a negative number"<<num_less<<"\n";
You have to use braces after an if construct if you plan to use multiple statements in that block.
If we don't add braces, only the first statement following the if condition is taken as a part of the block which executes if the condition is true.
Hence, you'll have to add braces for every if statement in your code.
QUOTE
else if (n = 0)
This is a common mistake made by many.
Use == to test if n is equal to zero. Using a single = simply sets the value 0 to n and returns true if successful.
Your final program should look like this:
CODE
#include<iostream>
using namespace std;
int main()
{
int num_great=0, num_less=0, num_is=0;
int c=0;
int n;
int x;
while ( c < x )
{
cout<<"Enter a number\n";
cin>>n;
c++;
if ( n < 0)
{
num_less=n;
cout<<"this is a negative number"<<num_less<<"\n";
}
else
{
if (n > 0)
{
num_great=n;
cout<<"this is a positve number"<<num_great<<"\n";
}
else
if (n == 0)
{
num_is=n;
cout<<"You entered zero but zero is nor positve or negative"<<num_is<<"\n";
}
}
}
return 0;
}