Advertisement
_Kripaka001_

hello-HELLO 0

Mar 20th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.73 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     char userWords[101];
  8.     int i,b,symbolNum;
  9.  
  10.     symbolNum=101;
  11.     cout << "enter symbols(words)(limit 30 symbols)" << endl;
  12.  
  13.     cin.getline(userWords,101);
  14.  
  15.     cout << "these symbols are taking part in the test now" << endl;
  16.     cout << userWords << endl;
  17.  
  18.     for (i = 0;i < symbolNum;i++){
  19.         if(userWords[i] == '\0'){
  20.             symbolNum=i;
  21.             break;
  22.         }
  23.     }
  24.  
  25.     int symbol=0;
  26.  
  27.     for ( i = 0;i < symbolNum;i++ ){
  28.          if(userWords[symbol] >= 'a' && userWords[symbol] <= 'z'){
  29.  
  30.             userWords[symbol]=(int)userWords[symbol]-32;
  31.  
  32.          }
  33.     }
  34.     cout<< " result----"<< endl;
  35.     cout<<userWords;
  36.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement