diff options
| author | austinsworld15 <[email protected]> | 2021-11-02 18:40:24 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-11-02 18:40:24 -0700 |
| commit | 37b25581954ba7e1d9667e53a2db468ea59a41d6 (patch) | |
| tree | bbe9b0e8bcb5d0b2268fe3f0f6d610064c0d0941 | |
| parent | Update CST116F2021-Lab5.cpp (diff) | |
| download | cst116-lab5-austinsworld15-37b25581954ba7e1d9667e53a2db468ea59a41d6.tar.xz cst116-lab5-austinsworld15-37b25581954ba7e1d9667e53a2db468ea59a41d6.zip | |
Update CST116F2021-Lab5.cpp
| -rw-r--r-- | CST116F2021-Lab5/CST116F2021-Lab5.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/CST116F2021-Lab5/CST116F2021-Lab5.cpp b/CST116F2021-Lab5/CST116F2021-Lab5.cpp index 1e66b67..e4c3529 100644 --- a/CST116F2021-Lab5/CST116F2021-Lab5.cpp +++ b/CST116F2021-Lab5/CST116F2021-Lab5.cpp @@ -294,4 +294,28 @@ int main() 7. +#include <iostream> + +using namespace::std; + +int main() +{ + constexpr char string_1[] = "Frank"; + constexpr char string_2[] = "Franklyn"; + int NumberOfLetters; + + cout << "How many letters do you want to compare between the names\n\n1 2 3 4 5 6 7 8 9 \n\nF r a n k and\nF r a n k l y n ?\n\n"; + cin >> NumberOfLetters; + const int res = _strnicmp(string_1, string_2, NumberOfLetters); + + if (res == 0) + { + cout << "\n\n--Same--\n\n\n\n"; + } + else + { + cout << "\n\n--Different--\n\n\n\n"; + } + return 0; +} |