Operators and functions in oops Arthi Singaravelan Senior Member 07-09-2013, 07:35 PM Operator: An operator is a symbol that specifies an operation to be performed. The basic types of operators are: Arithmetic operator Relational operator Logical operator Conditional operator Arithmetic operators: +, - , *, /, %, ^     They are used to perform some arithmetic operations. Relational operators: <,>,<=,>=,!=, ==     They are used to compare values.These operators return either true or false. Logical operators: &&, ||, !     These are the basic logical operators and they are used in decision making statements. Conditional operator: ?:           This operator is known as conditional operator. It may also be called as ternary operator. A c++ program to perform arithmetic operations: Code: ```#include #include class arith {  private:     int opt,num1,num2,res;  public:     void getdata()     {       cout<<"enter your option\n 1.add\n 2.sub\n 3.mul\n 4.div";       cin>>opt;       cout<<"enter the first number";       cin>>num1;       cout<<"enter the second number";       cin>>num2;       } }; void main() {   arith a;   a.getdata();   switch(opt)   {      case 1:           cout<<"ADDITION";           res=num1+num2;           cout<<"result of addition is"< #include class fun {  private:    int n;  public:    void getdata(); // Fnction declaration    void showdata()    {      cout<<"REGISTER NUMBER:"<>regno;  cout<<"enter your branch";  cin>>branch; } void main() {  fun f;  f.getdata();  f.showdata();  getch(); }    ``` Fear is a reaction,but courage is a destination venkateshmps V.I.P Team 07-09-2013, 08:05 PM @arthi how did u insert the text box Thanks to V+ Arthi Singaravelan Senior Member 07-09-2013, 08:23 PM just click the "insert code" icon in the toolbar Fear is a reaction,but courage is a destination « Next Oldest | « Next Newest