Como averiguar si un numero es negativo o positivo
en  Borland C++

#include <iostream.h>
#include <string.h>
#include <conio.h>
#include <stdlib.h>
void main()
{
int r;
cout <<"ingrese un numero:";
cin >> r;
if(r<0)
{
cout <<"el numero es negativo:"<<r<<endl;
}
else
{
cout<<"el numero es positivo:"<<r<<endl;
}
getch();
}




















Comentarios