0% found this document useful (0 votes)
4 views4 pages

Programs Assignment 1

The document is an assignment submission for a programming fundamentals course by Syed Maarige Ali. It includes two programming tasks: the first requires creating a program that performs basic arithmetic operations on two user-inputted numbers, and the second involves using assignment operators to update a variable's value. Both tasks are accompanied by C++ code examples demonstrating the required functionality.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views4 pages

Programs Assignment 1

The document is an assignment submission for a programming fundamentals course by Syed Maarige Ali. It includes two programming tasks: the first requires creating a program that performs basic arithmetic operations on two user-inputted numbers, and the second involves using assignment operators to update a variable's value. Both tasks are accompanied by C++ code examples demonstrating the required functionality.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

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:

You might also like