Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int const SIZE = 10;
- char arr[SIZE];
- int i, counter = 0;
- for (i = 0; i < SIZE; i++)
- {
- cout << "Enter a char for place number " << i << " in the array: ";
- cin >> arr[i];
- if (arr[i] >= 'A' && arr[i] <= 'Z')
- counter++;
- if (counter == 1 && arr[i] >= 'a')
- arr[i] = (int)arr[i] - 32;
- }
- cout << "The new array is: ";
- for (i = 0; i < SIZE; i++)
- cout << arr[i];
- cout << endl;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement