50 Programming Questions
1. Hello World: Write a program to print "Hello, World!" to the console.
2. Add Two Numbers: Write a program to add two numbers entered by
the user.
3. Find Maximum Number: Find the maximum number in an array.
4. Factorial: Write a function to calculate the factorial of a number.
5. Fibonacci Sequence: Generate the first N numbers in the Fibonacci
sequence.
6. Check Prime Number: Determine if a number is prime or not.
7. Reverse a String: Write a program to reverse a string.
8. Palindrome Checker: Check if a given word or phrase is a
palindrome.
9. Sum of Digits: Calculate the sum of the digits of a number.
10. Swap Two Variables: Swap the values of two variables
without using a third variable.
11. Count Vowels and Consonants: Count the number of
vowels and consonants in a string.
12. Find the Largest Element in an Array: Find the largest
element in an array.
13. Calculate Area and Perimeter: Calculate the area and
perimeter of a rectangle.
14. Calculate Simple Interest: Calculate simple interest based
on user input.
15. Even and Odd Numbers: Print even and odd numbers from
1 to N.
16. Check Leap Year: Determine if a given year is a leap year.
17. Reverse a Number: Reverse the digits of a number.
18. Check Anagrams: Check if two strings are anagrams of
each other.
19. Power of a Number: Calculate the power of a number
using recursion.
20. Calculate Factorial using Recursion: Calculate factorial
using a recursive function.
21. String Reversal without Library Function: Reverse a
string without using library functions.
22. Binary to Decimal Conversion: Convert a binary number
to decimal.
23. Decimal to Binary Conversion: Convert a decimal number
to binary.
24. Array Rotation: Rotate an array to the right by K positions.
25. GCD (Greatest Common Divisor): Find the greatest
common divisor of two numbers.
26. LCM (Least Common Multiple): Find the least common
multiple of two numbers.
27. Find Missing Number: Find the missing number in an array
of consecutive integers.
28. Array Sorting: Implement a simple sorting algorithm (e.g.,
bubble sort).
29. Linear Search: Perform a linear search to find an element
in an array.
30. Binary Search: Implement binary search in a sorted array.
31. Print Prime Factors: Print the prime factors of a given
number.
32. Print Prime Numbers: Print prime numbers up to N.
33. Armstrong Number: Check if a number is an Armstrong
number.
34. Print Patterns: Print various patterns using loops (e.g.,
triangle, square, diamond).
35. Calculator Program: Create a simple calculator program
with basic operations.
36. Sum of Series: Calculate the sum of a series (e.g., 1 + 2 +
3 + ... + N).
37. Matrix Operations: Perform basic matrix operations
(addition, multiplication).
38. Find Duplicate Elements: Find duplicate elements in an
array.
39. Find the Intersection of Two Arrays: Find the common
elements in two arrays.
40. Count Words in a String: Count the number of words in a
sentence.
41. Remove Duplicate Characters: Remove duplicate
characters from a string.
42. Check if a String Contains a Substring: Check if a string
contains a specified substring.
43. Implement a Stack: Implement a stack data structure.
44. Implement a Queue: Implement a queue data structure.
45. Linked List Operations: Implement basic linked list
operations (insertion, deletion).
46. Calculate Nth Fibonacci Number: Calculate the Nth
Fibonacci number using dynamic programming.
47. Find the Second Largest Element: Find the second
largest element in an array.
48. Reverse a Linked List: Reverse a singly linked list.
49. Check Balanced Parentheses: Check if a string containing
parentheses is balanced.
50. Find the Intersection of Two Linked Lists: Find the
intersection point of two linked lists.