Lab 4. C++ If, Switch 문 예제


Lab 4. C++ If, Switch 문 예제

Problem 1. Write a C++ program that asks the user for a number between 0 and 100. If the number is between 1 and 9, print out “ONE DIGIT BIG!” If it is between 10 and 99, print out “TWO DIGIT BIG!” And if the user number is out of range print out the phrase “INPUT OUT OF RANGE, PLEASE TRY AGAIN.” Compile and run your program with different values #include <iostream> using namespace std; int main() { int number; cout<<"Enter a number between 0 and 100" << endl; cin >> number; if(number <= 0 || nu...



원문링크 : Lab 4. C++ If, Switch 문 예제