// Console_If-Else.cpp : Defines the entry point for the console application. /*______________________________________________________ Learning C++: Lesson 4 Making Decisions With Multiple If Statements & Logical Operators Ron Kessler Updated 12 / 29 / 2016 to show simple if - else logic before nested logic Users enter a number and we tell them our conclusions _______________________________________________________ */ #include "stdafx.h" #include using namespace std; int main() { cout << "Working with Decision Structures: If-Else logic\n\n"; int num; cout << "Enter a number: "; cin >> num; //Block structure. If 1 condition is true, the structure stops testing if (num < 0) { cout << "You entered a negative number\n"; } else if (num == 0) { cout << "You entered zero\n"; } else if(num > 0) { cout << "You entered a positive number\n"; } return 0; }