π Programming Topics & Solutions
- Print βHello Worldβ.
[Filename - 0001_hello_world] - Calculate the sum of 3 numbers.
[Filename - 0002_sum_of_three] - Find the average of 4 subject marks.
[Filename - 0003_average_marks] - Read 2 numbers and swap them using a third temporary variable.
[Filename - 0004_swap_with_temp] - Find the area of rectangle, square, triangle, parallelogram, rhombus, trapezium and circle and volume of sphere, cylinder, cone, cube and cuboid.
[Filename - 0005_area_volume] - Find simple interest or compound interest and amount.
[Filename - 0006_interest_calculator] - Display whether a number is positive or negative.
[Filename - 0007_positive_negative] - Accept two unequal numbers and display the greater of the two numbers.
[Filename - 0008_greater_number] - Accept two numbers and if two numbers are equal then find the sum otherwise, their product.
[Filename - 0009_sum_or_product] - Check whether two angles are complementary, supplementary or neither.
[Filename - 0010_angle_check] - Calculate the profit and profit percent or the loss and the loss percent on the given cost and selling prices.
[Filename - 0011_profit_loss] - Print the natural numbers from 1 to (user defined number).
[Filename - 0012_natural_numbers] - Print even numbers from 0 to (user defined number).
[Filename - 0013_even_numbers] - Print numbers from (user defined number) to 1 in descending order.
[Filename - 0014_descending_order] - Print multiplication table up to 12 of given number.
[Filename - 0015_multiplication_table] - Accept a 3-digit number and print the sum of the first and second number and the product of first and last number.
[Filename - 0016_digit_operations] - Print a 3 digit number in the reverse order.
[Filename - 0017_reverse_number] - Accept any range of m and n and print all the odd numbers between them.
[Filename - 0018_odd_in_range] - Accept any number and check if it is even or odd.
[Filename - 0019_even_odd_check] - Accept any number and print whether the number is a prime number or not.
[Filename - 0020_prime_check] - Read a name and display in a triangular pattern.
[Filename - 0021_name_triangle]For example- L LA LAN LANGU LANGUA LANGUAG LANGUAGE - Find the sum, difference, product of any 2 numbers.
[Filename - 0022_basic_operations] - Swap 2 numbers without using a third variable.
[Filename - 0023_swap_without_temp] - Find the perimeter of a square, rectangle, triangle, circle, parallelogram, trapezium.
[Filename - 0024_perimeter] - Check if a person is eligible to vote or not.
[Filename - 0025_voting_eligibility] - Check if a person is a child or an adult.
[Filename - 0026_child_adult] - Write a calculator.
[Filename - 0027_calculator] - Check if a number is divisible by 7 or 3.
[Filename - 0028_divisibility_check] - Check if the number has 1, 2 or more digits.
[Filename - 0029_digit_count_check] - Check if a number is a palindrome or not.
[Filename - 0030_palindrome_number] - Check if an entered year is a leap year or not.
[Filename - 0031_leap_year] - Check if a number is neon number or not. (The sum of the digits of its square equals the original number itself.)
Eg - 92-> 81 -> 8+1=9
[Filename - 0032_neon_number] - Write a guessing game.
[Filename - 0033_guessing_game] - Calculate a 10% discount if the amount is above 10000 else a discount of 7.5%. Display the discount received and the final billing amount to be paid.
[Filename - 0034_discount_calculator] - Read three numbers and display the largest of the three numbers.
[Filename - 0035_largest_of_three] - Read two numbers and display the smaller of the two.
[Filename - 0036_smaller_of_two] - Read a number and a character. If the character is βSβ display the square of the number. If the character is βCβ then display the cube of the number.
[Filename - 0037_square_cube] - Read two numbers. If both numbers are even then display their sum else display their difference.
[Filename - 0038_even_sum_diff] - Read a character and check if the character is a vowel or a consonant.
[Filename - 0039_vowel_consonant] - Read two numbers and a Boolean value. For Boolean true display the area and perimeter of a rectangle assuming the two numbers are the length and width. For a Boolean false calculate and display the sum and product of the two numbers.
[Filename - 0040_boolean_operations] - Read two numbers and a character. If the character is βaβ check if the numbers are equal. If the character is βMβ check if the first number is divisible by 9. Otherwise find the product.
[Filename - 0041_conditional_operations] - Check if a string is a palindrome or not.
[Filename - 0042_palindrome_string] - Count the number of vowels in a string.
[Filename - 0043_count_vowels] - Read a line, then count words and display the total number of words in the given line.
[Filename - 0044_word_count] - Convert temperature from celsius to fahrenheit.
[Filename - 0045_celsius_fahrenheit] - Convert dollars to rupee with current conversion rate (take from internet).
[Filename - 0046_dollar_rupee] - Check if a character is uppercase or lowercase.
[Filename - 0047_case_check] - Add odd numbers upto a given value.
[Filename - 0048_sum_odd_numbers] - Calculate the BMI(Body Mass Index) of a person.
[Filename - 0049_bmi_calculator] - Input a value in kilometres and convert it into miles.
[Filename - 0050_km_to_miles] - Input 3 numbers and swap them as this : 1st number becomes 2nd number and 2nd number becomes the 3rd number and 3rd number becomes the 1st number.
[Filename - 0051_circular_swap] - Input the total liabilities and shareholdersβ equity of a company and print its D/E ratio.
[Filename - 0052_de_ratio] - Print numbers from 1 to 10 using a loop.
[Filename - 0053_1_to_10] - Use a while loop to find the sum of the first n(n input from user) natural numbers.
[Filename - 0054_sum_n_natural] - Print numbers from 1 to 10, but skip 5.
[Filename - 0055_1_to_10_no_5] - Take input from the user repeatedly until they type βexitβ.
[Filename - 0056_repeat_until_exit] - Print numbers from 1 to 10, but stop when number is 7.
[Filename - 0057_1_to_10_no_7] - Create a simple menu (looped) that exits when the user selects βQuitβ.
[Filename - 0058_menu_loop] - Count the number of digits in a number using while.
[Filename - 0059_count_digits] - Reverse a number.
[Filename - 0060_reverse_number] - Print all numbers from 1 to (user defined number) that are divisible by both 3 and 7.
[Filename - 0061_divisible_3_and_7] - Find the grade based on marks using if-elif-else:
- 90-100: A
- 75-89: B
- 50-74: C
- <50: Fail
[Filename - 0062_grade_calculator]
- Print all odd numbers from 1 to (user defined number)
[Filename - 0063_odd_numbers] - Calculate the factorial of a number using a loop.
[Filename - 0064_factorial] - Create a menu-driven program:
- Find Square
- Find Cube
- Exit
[Filename - 0065_square_cube_menu]
- Write a program to start a countdown from the number inputted by the user.
[Filename - 0066_countdown] - Write a program calculating exponentials using a loop.
[Filename - 0067_exponentials] - Write a program to accept the number of rows and print the following:
[Filename - 0068_pattern_descending]Eg. (No of rows: 5) 12345 1234 123 12 1 - Write a program to accept the number of rows and print the following:
[Filename - 0069_pattern_ones]Eg. (No of rows: 5) 11111 1111 111 11 1 - Write a program to check whether a number is a spy number. (sum of digits = product of digits).
Eg- 22 -> 2*2 = 2+2
[Filename - 0070_spy_number] - Write a program to accept the number of rows and print the following:
[Filename - 0071_pattern_reverse_desc]Eg. (No of rows: 5) 54321 4321 321 21 1 - Write a program to check whether a number is an Armstrong number. (sum of cube of digits is equal to the number).
Eg - 153 ->13+53+33= 153
[Filename - 0072_armstrong_number] - Write a program to accept the number of rows and print the following pattern:
[Filename - 0073_pattern_sixes]Eg. (No of rows: 3) 6666 6666 6666 - Write a program to print the Fibonacci sequence until the term specified by the user.
[Filename - 0074_fibonacci] - Write a program to add odd and even numbers until a number inputted by the user.
[Filename - 0075_sum_odd_even] - Write a program to check whether a character is uppercase or lowercase.
[Filename - 0076_char_case] - Check whether a number is a disarium number. (Sum of digits powered by position = number)
Eg. 135 -> 1ΒΉ + 3Β² + 5Β³ -> 1 + 9 + 125 -> 135
[Filename - 0077_disarium_number] - Write a program to check whether a number is a magic number. (sum of digits repeatedly checked turns to 1).
Eg. 73 -> 7+3=10 -> 1+0=1
[Filename - 0078_magic_number] - Write a program to calculate Accuracy, Precision, Recall, F1 score of an AI model.
[Filename - 0079_ml_metrics] - Write a script to find and display the nature of roots (Real or Complex) along with the roots of a quadratic equation.
[Filename - 0080_quadratic_roots] - Write a script to input three numbers and find whether they form the three sides of a triangle.
[Filename - 0081_triangle_check] - Write a script which inputs two numbers from the user and checks if the first number is divisible by the second or not. The script should then display an appropriate message.
[Filename - 0082_divisibility] - Find HCF and LCM of Two Numbers.
[Filename - 0083_hcf_lcm] - Print the following zig-zag number pattern for n =(user inputted number):
[Filename - 0084_zigzag_pattern]Eg - n = 4 1 2 3 4 5 6 7 8 9 10 - Write a program to:
- Take input n (number of terms), a (first term), and d (common difference).
- Print the first n terms of the arithmetic series.
- Calculate and print the sum of the series.
[Filename - 0085_arithmetic_series]Example: Input: n=5, a=2, d=3 Output: 2 5 8 11 14 Sum: 40
-
Write a program to check whether a number is a perfect number.
(A perfect number is equal to the sum of its proper divisors.)
Eg: 28 β 1+2+4+7+14 = 28
[Filename - 0086_perfect_number] - Write a program to check whether a number is an automorphic number.
(An automorphic numberβs square ends with the number itself.)
Eg: 25 β 25Β² = 625 ends with 25
[Filename - 0087_automorphic_number] - Write a program that takes a string input from the user and converts all lowercase letters to uppercase and all uppercase letters to lowercase, leaving digits and special characters unchanged.
[Filename - 0088_toggle_case] - Accept a string and a character and check how many words start with the character.
[Filename - 0089_first_character_check]
π Status
[!TIP] Click on the emojis to view/download the code.
| # | QBasic | Java | Python | C | C++ | C# | Haskell | Perl | Go | Elixir | Assembly | Fortran | Lua | Ruby | Visual Basic | PowerShell | Batch |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0001 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0002 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0003 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0004 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0005 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0006 | β | βοΈ | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0007 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0008 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0009 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0010 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0011 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0012 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0013 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0014 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0015 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0016 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0017 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0018 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0019 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0020 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0021 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0022 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0023 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0024 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0025 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0026 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0027 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0028 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0029 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0030 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0031 | β | βοΈ | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0032 | β | βοΈ | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0033 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0034 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0035 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0036 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0037 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0038 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0039 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0040 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0041 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0042 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0043 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0044 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0045 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0046 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0047 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0048 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0049 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0050 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0051 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0052 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0053 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0054 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0055 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0056 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0057 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0058 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0059 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0060 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0061 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0062 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0063 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0064 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0065 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0066 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0067 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0068 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0069 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0070 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0071 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0072 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0073 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0074 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0075 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0076 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0077 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0078 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0079 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0080 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0081 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0082 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0083 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0084 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0085 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0086 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0087 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0088 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
| 0089 | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β | β |
Legend
| Symbol | Status | Description |
|---|---|---|
| β | Finished | Program is complete and working |
| βοΈ | Beta | Program is functional but may have issues or is work-in-progress |
| β | Unfinished | Program not yet implemented or incomplete |