HEADER FILES & OPERATORS
#include<iostream>
using namespace std;
int main(){
cout<<"This is a hello world program\n";
float a=10;
float b=20;
cout<<"\nThe sum of a+b is :"<<a+b;/*arithmetic operators*/
cout<<"\nThe sum of a-b is :"<<a-b;/*arithmetic operators*/
cout<<"\nThe sum of a*b is :"<<a*b;/*arithmetic operators*/
cout<<"\nThe sum of a/b is :"<<a/b;/*arithmetic operators*/
cout<<"\n";
//Increment Decrement Operators//
cout<<"\nThe sum of a++ is :"<<a++; /*increment decrement operators*/
cout<<"\nThe sum of a++ is :"<<a; /*increment decrement operators*/
cout<<"\nThe sum of ++a is :"<<++a; /*increment decrement operators*/
cout<<"\nThe sum of a-- is :"<<a--; /*increment decrement operators*/
cout<<"\nThe sum of --a is :"<<--a; /*increment decrement operators*/
cout<<"\nThe sum of b++ is :"<<b++; /*increment decrement operators*/
cout<<"\n";
//Comparison Operators
cout<<"\n The value of a == b is :"<<(a==b); /*Comparison Operators*/
cout<<"\n The value of a > b is :"<<(a>b); /*Comparison Operators*/
cout<<"\n The value of a < b is :"<<(a<b); /*Comparison Operators*/
cout<<"\n The value of a >= b is :"<<(a>=b); /*Comparison Operators*/
cout<<"\n The value of a <= b is :"<<(a<=b); /*Comparison Operators*/
cout<<"\n The value of a != b is :"<<(a!=b); /*Comparison Operators*/
cout<<"\n";
//Logical Operators
cout<<"The value of a==b is "<<((a==b)&&(a<b))<<endl; /*Logical Operator*/
cout<<"The value of a==b is "<<((a==b)||(a<b))<<endl; /*Logical Operator*/
cout<<"The value of !a==b is "<<(!(a==b))<<endl; /*Logical Operator*/
return 0;
}
Comments
Post a Comment