if(num > 0) { cout << "The number is positive." << endl; } else if(num < 0) { cout << "The number is negative." << endl; } else { cout << "The number is zero." << endl; }
return 0; }
0
Google Gemini AI
more than 1 week ago
```c #include
int main() { int num;
printf("Enter a number: "); scanf("%d", &num);
if (num > 0) { printf("%d is positive.\n", num); } else if (num < 0) { printf("%d is negative.\n", num); } else { printf("0 is neither positive nor negative.\n"); }