diff options
| author | WiserJ <[email protected]> | 2021-11-02 15:53:40 -0700 |
|---|---|---|
| committer | WiserJ <[email protected]> | 2021-11-02 15:53:40 -0700 |
| commit | bd1bec7e68837bb7dc2ddce510433b8f0fbdb44c (patch) | |
| tree | f4f519c17809f48281a114de521800ca65ad61dc /CST116F2021-Lab5/p.273.cpp | |
| parent | 260 (diff) | |
| download | cst116-lab5-jeffwoit-bd1bec7e68837bb7dc2ddce510433b8f0fbdb44c.tar.xz cst116-lab5-jeffwoit-bd1bec7e68837bb7dc2ddce510433b8f0fbdb44c.zip | |
done 273
Diffstat (limited to 'CST116F2021-Lab5/p.273.cpp')
| -rw-r--r-- | CST116F2021-Lab5/p.273.cpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/CST116F2021-Lab5/p.273.cpp b/CST116F2021-Lab5/p.273.cpp new file mode 100644 index 0000000..fd493cd --- /dev/null +++ b/CST116F2021-Lab5/p.273.cpp @@ -0,0 +1,39 @@ +#include "Header1.h" + +void GetInput(char input_1[], char input_2[]) +{ + cout << "This program checks if the first six characters in a string are the same.\n"; + + cout << "Please enter your first string: "; + cin >> input_1; + + cout << "Please enter your second string: "; + cin >> input_2; +} + +void CompareInput(char comp_1[], char comp_2[]) +{ + int i = 0; + do + { + if (comp_1[i] == comp_2[i]) + { + if (i < CHAR_LIMIT-1) + { + i++; + } + else if (i == CHAR_LIMIT-1) + { + cout << "Same."; + i++; + } + } + else + cout << "Different."; + } while (i < CHAR_LIMIT); +} + +//void DispResult() +//{ +// +//}
\ No newline at end of file |