Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>;
- using namespace std;
- int main()
- {
- int i, k, numb, c;
- char h[100], nm;
- c = 1;
- cout << "Enter number of characters in array" << endl;
- cin >> numb;
- cout << endl << "Enter all the charachters of array" << endl;
- for (i = 0; i < numb; i++)
- cin >> h[i];
- for (nm = 'a'; nm <= 'z'; nm++)
- {
- for (i = 0; i < numb; i++)
- if (nm == h[i])
- {
- cout << c << ". " << h[i] << endl;
- c++;
- break;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment