Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- char str[500];
- char* ptr;
- cout << "Enter string " << std::endl;
- cin.getline(str, 500);
- ptr = strtok(str, " ");
- while(ptr!=NULL)
- {
- if(isupper(ptr[0]))
- cout << ptr <<endl;
- ptr = strtok(NULL, " ");
- }
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment