You can use compound expression in if
Code:
Ex.. if (age >= 0) if (age < 120) print age is valid to if (age >= 0) && (age < 120) print age is valid ========================= if (age < 0) || (age >= 120) print age is valid to if (age < 0)
Ex.. if (age >= 0) if (age < 120) print age is valid to if (age >= 0) && (age < 120) print age is valid ========================= if (age < 0) || (age >= 120) print age is valid to if (age < 0)
#include <iostream> #include <ctime> #include <cstdlib> #include <string>
#include <iostream> #include <ctime> #include <cstdlib> #include <string> using namespace std; //const int SUITS = 4;
int numInRank[13]; bool flag = true; //flag to determine if Ace is high or low cin.get(rankCh); switch (toupper(rankCh)) { case '-1': exit(0); case 'A':
public void straight() { int locations[] = new int[ 5 ], z = 0; for ( int y = 0; y < numbers.length; y++ ) if ( numbers[ y ] == 1 ) locations[ z++ ] = y;
Leave a comment: