Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cctype>
- using namespace std;
- int main(void)
- {
- char ch, next_ch;
- cout <<"Enter an alphabetic character: ";
- cin >> ch;
- if (isalpha (ch))
- {
- if ((ch == 'z'))
- next_ch = 'a';
- else if (ch == 'Z')
- next_ch = 'A';
- else
- next_ch = ch + 1;
- cout << "Next character of " << ch << "is" << next_ch << ".\n";
- }
- else
- cout << ch <<"is not alphabetic character.\n";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement