C++ programming to swap two numbers with temp local variable

preview_player
Показать описание
Swapping Numeric Values

Example program (next slide) takes in two integers, swaps them if first is greater, and then prints out lower number, followed by higher number
Uses single-alternative selection structure with statement block in true path
Creates temporary variable to accomplish swap
Temp variable can only be used in statement block in which it is declared; called a local variable
Рекомендации по теме