Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- const int SIZE = 10;
- void main()
- {
- cout << "question no. 4:\n----------------------\n\n";
- char charArray[SIZE], anotherCharacter, answer = 0;
- cout << "Please enter " << SIZE << " characters --> ";
- for (int i = 0; i < SIZE; i++)
- {
- cin >> charArray[i];
- }
- cout << "Please enter anothe character ---> ";
- cin >> anotherCharacter;
- while (anotherCharacter >= charArray[0] && anotherCharacter <= charArray[9])
- {
- answer++;
- }
- cout << answer << endl;
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment