UOG
SUB
CAMPUS
Submitted to: Sir Bilal Tariq Butt
Submitted by: Syed Maarige Ali
Subject: Programming fundamental
Assignment no: 1
Semester: 1st
Department: Computer Science
Submission date: 15th Oct 2025
1st Statement:
Write a program in which take two values from users in
different variables and print their addition, subtraction, multiplication,
and division.
#include <iostream>
using namespace std;
int main()
{ int num1, num2; cout << "Enter first number: "; cin
>> num1; cout << "Enter second number: "; cin >>
num2; cout << "\nAddition: " << num1 + num2 <<
endl; cout << "Subtraction: " << num1 - num2 <<
endl; cout << "Multiplication: " << num1 * num2
<< endl; cout<<"division:"<<num1/num2<<endl;
return 0;
}
Output SS :
2nd Statement:
Write a program in which (+, -, /, *) use these operators in
assignment operator to update the value.
#include <iostream>
using namespace
std; int main()
{ int a = 10; cout << "the value of a: "
<< a << endl; a += 5; cout << "a += 5,
a = " << a << endl; a -= 3; cout << "a -
= 3, a = " << a << endl;
a *= 2;
cout << "a *= 2, a = " << a << endl;
a /= 4;
cout << "a /= 4, a = " << a << endl;
return 0;
}
Output SS: