- Hello, World!: Write a program that prints the message “Hello, World!”.
- Sum of Two Numbers: Write a program that asks the user to enter two numbers, and then prints the sum of those two numbers.
- Addition: Write a program that assigns three numbers to variables num1, num2 and num3, and then calculates their sum and stores it in a variable result. Finally, print the value of result.
- Even or Odd: Write a program that asks the user to enter a number and then determines whether the number is even or odd.
- String Concatenation: Write a program that concatenates two strings str1 and str2 and stores the result in a variable result.
- Increment and Decrement: Write a program that increments and decrements the value of a variable num.
- User Input: Write a program that asks the user to enter their name, stores it in a variable name, and then prints a greeting using the name.
Programming problems to practice data types:
- Write a program that swaps the values of two variables using a temporary variable.
- Write a program that swaps the values of two variables without using a temporary variable.
- Write a program that takes a number as input and converts it into integer, float, and string.
- Write a program that takes a string as input and find the length of the string.
- Write a program that takes a string as input and convert it to uppercase or lowercase.
Programming problems to practice loops:
- Write a program that prints the numbers from 1 to 10.
- Write a program that prints the even numbers from 1 to 20.
- Write a program that prints the sum of all numbers from 1 to 100.
- Write a program that calculates the factorial of a given number.
- Write a program that prints the Fibonacci sequence up to a given number.
- Write a program that checks if a given number is prime.
- Write a program that prints the multiplication table of a number.
- Write a program that finds the largest element in an array.
- Write a program that prints the reverse of a given string.
- Write a program that calculates the sum of all elements in a list.
Programming problems to practice conditions:
- Write a program that takes an integer N as input and determines whether it is even or odd.
- Write a program that takes an integer N as input and determines whether it is positive, negative, or zero.
- Write a program that takes three numbers as input and determines the largest among them using conditional statements.
- Write a program that takes a year as input and determines whether it is a leap year or not.
- Write a program that takes a student’s score as input and calculates the corresponding grade based on the following conditions:
- 90 or above: A
- 80 to 89: B
- 70 to 79: C
- 60 to 69: D
- Below 60: F
- Write a program that takes a character as input and determines whether it is a vowel or consonant.
- Write a program that takes three numbers as input and determines whether their product is positive or negative.
- Write a program that takes an integer N as input and determines whether it is divisible by both 5 and 7.
- Write a program that takes three angles of a triangle as input and determines whether it is an equilateral, isosceles, or scalene triangle.
- Write a program that takes an integer N as input and determines whether it falls within a specific range, such as 1 to 100.
Programming problems to practice functions:
- Write a function that calculates the factorial of a given number N and returns the result.
- Write a function that takes a string as input and determines whether it is a palindrome or not.
- Write a function that takes two integers as input and calculates their greatest common divisor.
- Write functions to calculate the area of different geometric shapes such as squares, rectangles, circles, and triangles.
- Write a function that takes two strings as input and determines whether they are anagrams (contain the same characters in a different order) or not.
- Write functions to convert temperatures between Fahrenheit and Celsius.
Programming problems to practice array:
- Write a program that takes an array of integers as input and calculates the sum of all the elements in the array.
- Write a program that takes an array of integers as input and calculates the average of all the elements in the array.
- Write a program that takes an array of integers as input and determines the smallest element in the array.
- Write a program that takes an array of integers as input and returns a new array with the elements in reverse order.
- Write a program that takes an array of integers as input and sorts the elements in ascending or descending order.
- Write a program that takes an array of integers and a target number as input and determines whether the target number is present in the array.
- Write a program that takes an array of integers and a rotation count as input. Rotate the elements of the array to the right by the given rotation count.
- Write a program that takes two arrays of integers as input and returns a new array containing the common elements between the two arrays.
- Write a program that takes an array of integers and a value to remove as input. Remove all occurrences of the value from the array and return the modified array.
Word Problems:
- Sandip wants to buy a new smartphone that costs Rs 5000. She has saved Rs 2500 so far. How much more money does Sandip need to save?
- Dheeraj is planning a road trip. The total distance he wants to cover is 800 kilometers. If he has already driven 450 kilometers, how many more kilometers does he need to travel?
- Ayushman wants to distribute 120 candies equally among his 5 friends. How many candies will each friend receive, and how many candies will be left with Ayushman?
- PIn a store, a book costs Rs 250. If Kunal wants to buy 4 books, what will be the total cost?
- A recipe requires 2 cups of milk, 1 cup of sugar, and 3 mangoes. If Adarsh wants to double the recipe, how much milk, sugar, and mangoes will he need?
Discussion
Ask a question, share your thoughts or report an error.
Sign in to participate in the discussion.
Join the discussion