1. Program to check whether a given number is positive or negative using the ternary operator.
#include <iostream.h>
#include <conio.h>
int main() {
int num;
cout << "Enter a number: ";
cin >> num;
(num > 0) ? cout << num << " is positive." : cout << num << " is negative or zero.";
getch();
return 0;
}