Math, asked by kesharwanisaaransh, 1 month ago

Write a program having the 3 variables num1, num2, num3 to store three integers with a member method numbervalue() through parameters . Find the maximum and minimum numbers by using the ternary operator and print​

Answers

Answered by mymissanand057
2

Step-by-step explanation:

Hope helpful for you Mark me as brainlist please. give me some thanks. and follow.

Attachments:
Answered by dhairyasumesara
0

Answer:

Program to find the largest number among two numbers using ternary operator.

// C++ program to find largest among

// two numbers using ternary operator

#include <iostream>

using namespace std;

int main()

{

// Variable declaration

int n1 = 5, n2 = 10, max;

// Largest among n1 and n2

max = (n1 > n2) ? n1 : n2;

// Print the largest number

cout << "Largest number between "

<< n1 << " and " << n2

<< " is " << max << ".";

return 0;

}

Step-by-step explanation:

mark it as BRAINLIEST

Similar questions