djelad1

Untitled

Nov 14th, 2014
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 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, answer = 0;
  9.  
  10. cout << "Please enter " << SIZE << " characters --> ";
  11.  
  12. for (int i = 0; i < SIZE; i++)
  13. {
  14. cin >> charArray[i];
  15. }
  16. cout << "Please enter anothe character ---> ";
  17. cin >> anotherCharacter;
  18. while (anotherCharacter >= charArray[0] && anotherCharacter <= charArray[9])
  19. {
  20. answer++;
  21. }
  22. cout << answer << endl;
  23. system("pause");
  24. }
Advertisement
Add Comment
Please, Sign In to add comment