Advertisement
Guest User

Untitled

a guest
Nov 26th, 2014
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. int const SIZE = 10;
  2. char arr[SIZE];
  3. int i, counter = 0;
  4. for (i = 0; i < SIZE; i++)
  5. {
  6. cout << "Enter a char for place number " << i << " in the array: ";
  7. cin >> arr[i];
  8. if (arr[i] >= 'A' && arr[i] <= 'Z')
  9. counter++;
  10. if (counter == 1 && arr[i] >= 'a')
  11. arr[i] = (int)arr[i] - 32;
  12. }
  13. cout << "The new array is: ";
  14. for (i = 0; i < SIZE; i++)
  15. cout << arr[i];
  16. cout << endl;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement