/* AUTORE: Manuel Vichi Funzione segno */ #include #include #include #include using namespace std; signed int sign(int number) { if (number > 0) return +1; else if (number == 0) return 0; else return -1; } int main() { signed int numero; cout << "Inserisci un numero: "; cin >> numero; cout << endl << "Ricorda: La funzione segno stampa -1 se il numero e' negativo e +1 se il numero e' positivo." << endl << "Risultato della funzione segno: " << sign(numero) << endl; return 0; }