Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

EE-133L Programming Fundamentals

Spring 2024

1. Registration number 2023-EE-1, 2023-EE-2, 2023-EE-3


Name A, B, C

Operators
Objective:
1. Develop a clear understanding of basic arithmetic, logic, and assignment operators in C
programming.

Task 1:
 Declare two integer variables, “a” and “b”.
 Perform addition, subtraction, multiplication, division, and modulus operations on a and
b.
 Print the results for each operation.

Hint:
+ (Addition)
- (Subtraction)
* (Multiplication)
/ (Division)
% (Modulus - remainder of division)

Code:

Output:

Explanation:

Task 2:
Print your roll number (for example 123), then print it in reverse order (for example 321).
Hint: One of the arithmetic operators can be used.

Instructor: Miss Rimsha Chauhdary


EE-133L Programming Fundamentals
Spring 2024

Code:

Output:

Explanation:

Task 3:
 Declare two variables, x and y.
 Implement logical AND, OR, and NOT operations on x and y.
 Print the results for each operation.

Hint:
&& (Logical AND)
|| (Logical OR)
! (Logical NOT)

Code:

Output:

Explanation:

Task 4:
 Declare a variable count and initialize it with 5.
 Use assignment operators (+=, -=, *=, /=) to modify the value of count.
 Use the increment (++) and decrement (--) operators to modify the value of count.
 Print the updated value of count after each operation.

Code:

Output:

Instructor: Miss Rimsha Chauhdary


EE-133L Programming Fundamentals
Spring 2024

Explanation:

Conclusion:

Instructor: Miss Rimsha Chauhdary

You might also like