5 Practice Questions on Arithmetic Operators
Hi! My name is Safia Khatoon. I am complete my Bachelors in Technology from RTC Institute Of Technology. My specialisation in Computer Science and Engineering.I love contributing to Open Source with the help of the skills I gain.
Also, I'm working on my YouTube Channel as well where I teach about DevOps tools and make technical content. You can have a look at it through my profile.
Feel free to reach out to me! I'd be happy to connect with you.
Q1️⃣ ➔ Make a Simple Calculator
Take 2 numbers from the user.
Then, perform and print results for + - / // % * all operations separately.
Hint: Similar to the earlier programs we discussed — but try writing it yourself first!
Q2️⃣ ➔ Total and Average of a Student’s 5 Subject Marks
Take marks of 5 subjects as input from the user.
Calculate total marks and average marks using
+and/.Display output clearly like:
Total Marks = 450 Average Marks = 90.0
Q3️⃣ ➔ Find Area and Perimeter of a Rectangle
Take length and breadth as input from the user.
Area = length × breadth
Perimeter = 2 × (length + breadth)
Print both results properly.
Q4️⃣ ➔ Time Conversion Program
Take total seconds input from the user.
Convert it into minutes and seconds:
Minutes = seconds
//60Remaining Seconds = seconds
%60
Example:
Input: 125 seconds Output: 2 minutes 5 seconds
Q5️⃣ ➔ Power and Remainder Program
Take two numbers from the user (base and exponent).
Find the power of the base (
**operator).Then take another number and find the remainder (
%) after division.Example:
Enter base: 2 Enter exponent: 5 Power: 32 Enter divisor: 3 Remainder after dividing 32 by 3: 2
🎯 Quick Recap:
| Question No. | Topic |
| Q1 | Full calculator |
| Q2 | Total and average of marks |
| Q3 | Area and perimeter |
| Q4 | Seconds to minutes conversion |
| Q5 | Power and remainder |