User-Defind C++ Program with Class Constractor

  1. #include<iostream>  
  2. //#include<stdafx.h>  
  3. class Contructor  
  4. {  
  5. char chr;  
  6. public:void acceptnumber()  
  7. {  
  8.     cout<< "Enter a charcter:";  
  9.     cin>>chr;  
  10.     if(chr=='A')  
  11.         cout<<"the charcter is A";  
  12.     else  
  13.         cout<<"the charactor is not A";  
  14. }  
  15. };  
  16. int main()  
  17. {  
  18.     Contructor C1;  
  19.     C1.acceptnumber();  
  20.     return 0;  
  21. }