From d0f5ad9a5db08f3831fdb77b9e223855db3431b9 Mon Sep 17 00:00:00 2001 From: Asahel Date: Sat, 3 Feb 2024 12:04:14 -0800 Subject: Implemented a forloop solution. --- Homework 4/program.cpp | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'Homework 4/program.cpp') diff --git a/Homework 4/program.cpp b/Homework 4/program.cpp index b3f854e..c851742 100644 --- a/Homework 4/program.cpp +++ b/Homework 4/program.cpp @@ -5,3 +5,38 @@ #include +using std::cout; +using std::endl; +using std::cin; + +void Print() { + + for (int i = 0; i <= 100; i++) { + cout << i << " "; + } +} + int main() { + + cout << "A. Print(100)" << endl; + cout << "B. Input Personal Information" << endl; + cout << "C. Print Fibonacci" << endl; + cout << "D. Exit" << endl; + + char input = 'A'; + + switch (input) { + case 'A': + Print(); + break; + } + + int month; + int day; + int year; + + cout << "Enter your date of birth"; + cin >> month >> day >> year; + + + return 0; + } \ No newline at end of file -- cgit v1.2.3