diff options
author | Oskar <[email protected]> | 2024-08-29 13:27:45 +0200 |
---|---|---|
committer | Oskar <[email protected]> | 2024-08-29 13:27:45 +0200 |
commit | 743c47c671347a0ac0f8f64b7117b48c65bab073 (patch) | |
tree | 5e33efe7a3e4d6ba5a9a6ee34762e978b51cb6b3 /5p7.cpp | |
parent | 1208defdbc457a89c0d9aea3b8faf86b8492761f (diff) |
more
Diffstat (limited to '5p7.cpp')
-rw-r--r-- | 5p7.cpp | 43 |
1 files changed, 43 insertions, 0 deletions
@@ -0,0 +1,43 @@ +#include <iostream> + +/* + * + * 5.7 + * + * + */ + +int get_value() { + + return 373; +} + +int main () { + + int ival1 = 50; + int ival2 = 100; + int minval = 10; + int occurs = 40; + int ival = 50; + if(ival1 != ival2) + ival1 = ival2; + else ival1 = ival2 = 0; + + if(ival < minval) { + minval = ival; + occurs = 1; + } + + int ival3; + if((ival3 = get_value())) + std::cout << "ival = " << ival << std::endl; + if(!ival3) + std::cout << "ival = 0\n"; + + if(ival == 0) + ival = get_value(); + + if(occurs) // stop compiler from complaining + + return 0; +} |