Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Tenary operator in QB64 with 4 numbers
#8
@a740g & RhoSigma - Yes, it is not in my books yet. Otherwise, in C++ it works like in QB64 with three numbers:

Basic & C++ rulez!  Big Grin
Code: (Select All)

//max example - https://legacy.cplusplus.com/reference/algorithm/max/
//Beispiel in C++ zu QB64 MAX/MIN - 19. Dez. 2024

#include <iostream>  // std::cout
#include <algorithm>  // std::max
#include <iomanip>    //setw() und cin.width(int) 
#include <string>

using namespace std;

int main(void)
{
double a, b, c, maximum;

system("cls");
cout << '\n' << "Maximum dreier Zahlen" << '\n' << '\n';

cout << "Zahl 1: "; cin >> a;
cout << "Zahl 2: "; cin >> b;
cout << "Zahl 3: "; cin >> c;
maximum = max(max(a, b), c);

cout << '\n' << "Die groesste Zahl ist: ";
cout << fixed << setprecision(2) << setw(4) << maximum << '\n';

  cout << endl;
  return 0;
}

[Image: Maximum-C-2024-12-19.jpg]
Reply


Messages In This Thread
RE: Tenary operator in QB64 with 4 numbers - by Kernelpanic - Yesterday, 06:58 PM



Users browsing this thread: 1 Guest(s)