This repository contains solutions to a series of programming exercises aimed at developing fundamental problem-solving skills using C++. The tasks focus on basic arithmetic operations, user input, and logical implementations.
- Description: Write a program that takes an integer input from the user and prints it.
- Example:
- Input:
5 - Output:
5
- Input:
- Description: Write a program that asks the user to input three integers and outputs their sum.
- Example:
- Input:
Please enter first number: 5 Please enter second number: 3 Please enter third number: 4 - Output:
Summation of 3 integers is 12
- Input:
- Description: Write a program that calculates the average of three integers entered by the user and displays the result as a decimal number.
- Example:
- Input:
Please enter first number: 6 Please enter second number: 4 Please enter third number: 4 - Output:
The average = 4.66667
- Input:
- Description: Write a program to compute the perimeter and area of a rectangle based on user-input width and height.
- Example:
- Input:
Width = 5 Height = 3 - Output:
The perimeter = 16 The area = 15
- Input:
- Description: Write a program that calculates the sum of the digits of a three-digit number entered by the user.
- Example:
- Input:
132 - Output:
6
- Input:
- Description: Write a program that converts a given integer (representing seconds) into hours, minutes, and seconds.
- Example:
- Input:
25300 - Output:
H:M:S - 7:1:40
- Input:
- Make sure you have a C++ compiler installed (e.g., GCC or an IDE like Visual Studio Code).
- Clone this repository or copy the program code into your local environment.
- Compile the code using the command:
g++ -o output_name program_name.cpp
- Run the compiled program:
./output_name
- Follow the prompts for user input.
- Each program is implemented as a standalone C++ file.
- Ensure proper formatting of user input for accurate results.
- Comments are included in the code to explain the logic and computations.
This project is licensed under the MIT License.