You are on page 1of 5

PROGRAMMING FUNDAMENTALS (CSC131) Ayesha zaheer | pg#

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";

Instructor: Mahrose Fatima Naqvi


PROGRAMMING FUNDAMENTALS (CSC131) Ayesha zaheer | pg#

// 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;
}

Instructor: Mahrose Fatima Naqvi


PROGRAMMING FUNDAMENTALS (CSC131) Ayesha zaheer | pg#

OUTPUT:-

TASK NO :- 3

#include <iostream>
using namespace std;
int main () {

int a = 10001010;
int b = 10000101;
cout<< a << "&" << b << ":" << (a & b) <<endl;

Instructor: Mahrose Fatima Naqvi


PROGRAMMING FUNDAMENTALS (CSC131) Ayesha zaheer | pg#

cout<< a << "|" << b << ":" << (a | b) <<endl;


cout<< a << "^" << b << ":" << (a ^ b) ;
cout<< a << "~" << b << ":" << (~a) <<endl;
cout<< a << "~" << b << ":" << (~b) <<endl;

return 0;
}

OUTPUT:-

Instructor: Mahrose Fatima Naqvi


PROGRAMMING FUNDAMENTALS (CSC131) Ayesha zaheer | pg#

TASK NO :- 2
int a = 9;
int b = 8;

cout<< "Is it true:" << (a < b || a == b) <<endl;


cout<< "Is it true:" << (a <= b || a >= b) <<endl;
cout<< "Is it true:" << (b < a || a < b) <<endl;
cout<< "IS it true:"<< (a >= b || a <= b) <<endl;

return 0;
}
OUTPUT:-

Instructor: Mahrose Fatima Naqvi

You might also like