Facebook
From LOL, 7 Months ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 399
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.     string x;
  7.     cout << "Enter Indentifier: ";
  8.     cin>>x;
  9.  
  10.     if(x[0]=='-'||x[0]=='!'||x[0]=='@'||x[0]=='$'||x[0]=='#'||x[0]=='*'
  11.        ||x[0]=='%'||x[0]=='+'||x[0]=='/'||x[0]=='>'||x[0]=='<'||x[0]=='^'||x[0]=='&')
  12.     {
  13.         cout << "Not Valid!" << endl;
  14.     }
  15.     else if(x=="float"||x=="double"||x=="printf"||x=="scanf"||x=="int")
  16.     {
  17.         cout << "VALID!" << endl;
  18.     }
  19.     else
  20.     {
  21.         cout << "Not Valid";
  22.     }
  23.  
  24. }
  25.