
Switch statement c++ example program pdf
EXAMPLE//// Demonstrates switch statement#includeint main(){// Program to build a simple calculator using switch Statementinclude using namespace std; int main() { char oper; float num1, num2; cout > oper; cout > num1 >> num2; switch (oper) { case '+': cout << num1 << + << num2 << = << num1 + num2 A switch statement allows a variable to be tested for equality against a list of values. The syntax of switch statement is: switch (var expression) { case This C++ program illustrates use of the s
Switch statement c++ example program pdf download link: