#include<iostream>
using namespace std;
// Tut6 contains info. about oprators
int main(){
int a=3,b=4;
cout<<"Operators in C++"<<endl;
cout<<endl;
cout<<"Following are the types of operators:"<<endl;
cout<<endl;
cout<<endl;
//*********** 1. Arithmetic operators ***********
cout<<"*********************** 1.ARITHMETIC OPERATORS IN C++ *****************************"<<endl;
cout<<endl;
cout<<endl;
cout<<"Following are Arithmetic operators in C++ :"<<endl;
cout<<endl;
cout<<"The value of a+b is :"<<a+b<<endl;
cout<<"The value of a-b is :"<<a-b<<endl;
cout<<"The value of a*b is :"<<a*b<<endl;
cout<<"The value of a/b is :"<<a/b<<endl;
cout<<"The value of a%b is :"<<a%b<<endl;
cout<<"The value of a^b is :"<<(a^b)<<endl;
cout<<"The value of a++ is :"<<a++<<endl;
cout<<"The value of a-- is :"<<a--<<endl;
cout<<"The value of --a is :"<<--a<<endl;
cout<<"The value of ++a is :"<<++a<<endl;
cout<<endl;
cout<<endl;
cout<<endl;
cout<<endl;
//********** 2.Logical operators *************
cout<<"*********************** 2.LOGICAL OPERATORS IN C++ *****************************"<<endl;
cout<<endl;
cout<<endl;
cout<<"Following are Logical operators in C++ :"<<endl;
cout<<endl;
cout<<"The logical AND value of following logical and arithmetic operator (a==b) and (a<b) is : "<<((a==b) && (a<b))<<endl;
cout<<"The logical AND value of following logical and arithmetic operator (a==b) and (a<b) is : "<<((a!=b) && (a<b))<<endl;
cout<<"The logical OR value of following logical and arithmetic operator (a==b) and (a<b) is : "<<((a==b) || (a<b))<<endl;
cout<<"The logical OR value of following logical and arithmetic operator (a==b) and (a<b) is : "<<((a!=b) || (a<b))<<endl;
cout<<"The logical NOT value of following operator (a!=b) is : "<<(a!=b)<<endl;
cout<<endl;
cout<<endl;
cout<<endl;
cout<<endl;
//*********** 3.Assignment operators ************
cout<<"*********************** 3.ASSIGNMENT OPERATORS IN C++ *****************************"<<endl;
cout<<endl;
cout<<endl;
cout<<"Following are Assignment operators in C++ :"<<endl;
cout<<endl;
cout<<"Assingment operators are used to assign values to variables";
cout<<"int a=5, b=6 and char='d' like that";
cout<<endl;
cout<<endl;
cout<<endl;
cout<<endl;
//********** 4.Comparison operators **************
cout<<"*********************** 4.COMPARISON OPERATORS IN C++ *****************************"<<endl;
cout<<endl;
cout<<endl;
cout<<"Following are Comparison operators in C++ :"<<endl;
cout<<endl;
cout<<"The value of a==b is :"<<(a==b)<<endl;
cout<<"The value of a!=b is :"<<(a!=b)<<endl;
cout<<"The value of a>=b is :"<<(a>=b)<<endl;
cout<<"The value of a<=b is :"<<(a<=b)<<endl;
cout<<"The value of a>b is :"<<(a>b)<<endl;
cout<<"The value of a<b is :"<<(a<b)<<endl;
cout<<endl;
cout<<endl;
cout<<endl;
cout<<endl;
cout<<"************************ This is end of operators in C++ ****************************";
return 0;
}
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.