StudyLover
  • Home
  • Study Zone
  • Profiles
  • Contact us
  • Sign in
StudyLover 6. Program to check whether a given number is positive or negative using the ternary operator.
Download
  1. C++ Programs list
5. Program to find the roots of a quadratic equation. : 7. Program to generate the Fibonacci sequence.
C++ Programs list

1.      Program to check whether a given number is positive or negative using the ternary operator.

  1. #include <iostream.h>

  2. #include <conio.h>

  3. int main() {

  4.     int num;

  5.     cout << "Enter a number: ";

  6.     cin >> num;

  7.     (num > 0) ? cout << num << " is positive." : cout << num << " is negative or zero.";

  8.     getch();

  9.     return 0;

  10. }

5. Program to find the roots of a quadratic equation. 7. Program to generate the Fibonacci sequence.
Our Products & Services
  • Home
Connect with us
  • Contact us
  • +91 82955 87844
  • Rk6yadav@gmail.com

StudyLover - About us

The Best knowledge for Best people.

Copyright © StudyLover
Powered by Odoo - Create a free website