int size = 10;
int weight = 25;
if (size = 10)
{ cout << "correct size and weight! n"; } if (weight = 25) {
cout << "correct size and weight! n"; }
Describe how following nested If-statements could be replaced with one if-statement by using logical operator (And/Or/Not). Give a C++ code example.
Distinguish the syntax and purpose of while-loop and syntax of a for-loop. Give C++ code examples of both loops and descriibe the main differences.