Professional Documents
Culture Documents
PF Lab 3
PF Lab 3
LAB 3
TASK N0:- 1
#include <iostream>
using namespace std;
int main (){
//AIRTHMRETIC OPERATOR
int a = 4;
int b = 5;
int c = 6;
cout<< "The three values over which all operators performmimg are" << a <<
"And" << b << " And" << c <<endl;
//ADDITION
int d = a+b+c ;
cout<< "The value of addition is" << d << "\n";
//SUBTRACTION
int e = a-b-c;
cout<< "The value of sutraction is" << e << "\n";
// MULTIPICATION
int f = a*b*c;
cout<< "the value of multipication is" << f << "\n";
// QIOTIENT
int g = a/b/c;
cout<< "The value of quotient is" << g << "/n";
// REMAINDER
int h = a%b%c;
cout<< "The value of remainder is" << h << "/n";
//RELATION OPERATORS
int n1 = 20;
int n2 = 25;
int n3 = 30;
cout<< "Is" << n1 << "<" << n2 << "<" << n3 << ":" <<(n1<n2<n3)<<endl;
cout<< "Is" << n1 << ">" << n2 << ">" << n3 << ":" <<(n1>n2>n3)<<endl;
cout<< "Is" << n1 << "<=" << n2 << "<=" <<n3 << ":" <<(n1<=n2<=n3)<<endl;
cout<< "Is" << n1 << ">=" << n2 << ">=" << n3 << ":" <<(n1>=n2>=n3)<<endl;
cout<< "Is" << n1 << "==" << n2 << "==" << n3 << ":" <<(n1==n2==n3)<<endl;
cout<< "Is" << n1 <<"!=" << n2 << "!=" << n3 << ":" <<(n1!=n2!=n3)<<endl;
return 0;
}
OUTPUT:-
TASK NO :- 3
#include <iostream>
using namespace std;
int main () {
int a = 10001010;
int b = 10000101;
cout<< a << "&" << b << ":" << (a & b) <<endl;
return 0;
}
OUTPUT:-
TASK NO :- 2
int a = 9;
int b = 8;
return 0;
}
OUTPUT:-