djelad1

Untitled

Nov 14th, 2014
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. const int SIZE = 10;
  4. void main()
  5. {
  6. cout << "question no. 4:\n----------------------\n\n";
  7.  
  8. char charArray[SIZE], anotherCharacter,
  9. int answer = 0;
  10.  
  11. cout << "Please enter " << SIZE << " characters --> ";
  12.  
  13. for (int i = 0; i < SIZE; i++)
  14. {
  15. cin >> charArray[i];
  16. }
  17. cout << "Please enter another character ---> ";
  18. cin >> anotherCharacter;
  19. while (anotherCharacter >= charArray[0] && anotherCharacter <= charArray[9])
  20. {
  21. answer++;
  22. }
  23. cout << answer << endl;
  24. system("pause");
  25. }
Advertisement
Add Comment
Please, Sign In to add comment