Assignment 5 - Loops
Assignment 5 - Loops
Welcome to Assignment 5 for the course on Programming Fundamentals. This assignment focuses
on Loops in C++. The purpose of this assignment is to strengthen your programming logic and
control flow understanding through practical tasks involving loops and conditionals. You will write
C++ programs using only standard libraries (specifically stdlib.h for srand() if required).
Submission Guidelines
Instructions
Questions
Q1 - Temperature Converter
Prompt for input temperature and convert accordingly. Loop this process for multiple conversions.
Q2 - Date Formatter
Prompt user to enter date as three integers: month, day, year. Output formatted like:
Add correct suffixes (st, nd, rd, th). Repeat input collection.
Q9 - GCD Calculator
Calculate GCD of two given integers using Euclidean Algorithm.
Swap first and last digits of a given number and generate the new number after swapping.
Bonus Question
Sample Output 1:
Enter the starting value: 5
Enter the ending value: 15
Digit Frequency
0 1
1 7
2 1
3 1
4 1
5 2
6 1
7 1
8 1
9 1
Sample Output 2:
Digit Frequency
0 3
1 13
2 13
3 4
4 3
5 3
6 3
7 3
8 3
9 3