hi!!
i just started programming some stuff in c++.
i made a simple program that compares a number given by the user to 0 n say if its cero, positive or negative.
// num_positivo_negativo.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <math.h>
#include <windows.h>
#include <stdio.h>
#include <iostream> //para las versiones nuevas de C++
#include <iostream.h> //para las versiones más viejas, como Borland C++
int main(int argc,char* argv[])
{
int num;
cout << " Ingrese un número: ";
cin << num;
if (num = 0)
{
cout << "El número es igual a cero"; // says that is 0
}
else
if (num < 0)
{
cout <<"Numero negativo"; // says that is negative
}
else
{
cout <<"Numero positivo"; // says that is positive
}
return 0;
}
but, then it gave me this error:
num_positivo_negativo.cpp(17) : error C2676: binary '<<' : 'class istream_withassign' does not define this operator or a conversion to a type acceptable to the predefined operator
hope some1 can help me
thanks!!
cyaa!!
gispe!! :)