These programming problems cover fundamental concepts and functionalities across programming languages, enabling easy transition among languages. Additional contributions are welcome, prioritizing conciseness and avoiding redundancy.
- Absolute Basics: Comments, Variables, Operators, Input / Output
- Write a program to greet the user with their name.
- Convert temperature from Fahrenheit to Celsius and vice-versa.
- Write a program to find the area of Circle, Triangle and Rectangle.
- Control Flow: Conditions, Loops, Switch-Case
- Write a guessing game with how many tries were needed.
- Write a program to calculate the sum of digits of a number.
- Write a program to find the largest among three numbers.
- Write a program to display student grades using switch cases.
- Data Structures: Array, String
- Write a program that tests whether a string is a palindrome.
- Write a program that reverses an array, preferably in place.
- Write a program to remove duplicate numbers from an array.
- Return difference between largest and smallest element in an array.
- Write a program that merges two different arrays into a new sorted array.
- Functions: Recursion, Lambda
- Write a program to find the GCD and LCM of two numbers.
- Find the power of a number using different loops and recursion.
- Find factorial of a given number using different loops and recursion.
- Write a function that prints first n numbers of Fibonacci sequence.
- Pointers and References:
- Write a program that swaps the values of two variables using pointers.
- Return the maximum and minimum values using references from the array.
- File and Database:
- Write a program that reads data from a file, performs some calculations, and writes the results to another file.
- Implement a program that searches for a specific string in a text file and counts its occurrences.
- Create a program that connects to a database, retrieves data from a table, and displays it.
- Implement a program that allows users to insert, update, and delete records in a database table.
- Exception Handling:
- Write a program that asks the user for two numbers and performs division, handling the exception when the denominator is zero.
- Implement a function that reads a file and handles exceptions for file opening and reading errors.
- Object-Oriented Programming:
- Create a class representing a Bank Account. Implement methods to deposit, withdraw, and display the account balance.
- Implement a class hierarchy for different types of vehicles, such as Car, Motorcycle, and Truck. Include common attributes and behaviors, and specific attributes and behaviors for each vehicle type.
- Miscellaneous: