Randomized Programming Questions (Numbered)
1. 37. Write a program to calculate the sum and average of elements in an array.
2. 21. Write a function to calculate the greatest common divisor (GCD) of two numbers.
3. 25. Write a function to count the number of vowels in a given string.
4. 6. Write a program to find the largest of three numbers using if-else statements.
5. 34. Write a program to count the number of set bits in an integer.
6. 41. Write a program to add two vectors element-wise.
7. 9. Write a program to classify a character as a vowel or a consonant.
8. 36. Write a program to find the largest and smallest elements in an array.
9. 44. Write a program to remove duplicates from a vector.
10. 26. Write a program to convert a decimal number to binary.
11. 46. Write a program to find the second largest element in an array using a loop.
12. 22. Write a function to check if a number is palindrome.
13. 5. Demonstrate type conversion (implicit and explicit) with examples.
14. 1. Write a program to swap two variables without using a third variable.
15. 45. Write a program to find the frequency of each element in a vector.
16. 19. Write a program to print a Pascal's triangle pattern.
17. 32. Write a program to check if a number is a power of 2 using bitwise operators.
18. 17. Write a program to print a diamond pattern of stars.
19. 2. Define a constant and demonstrate its usage in a program.
20. 11. Write a program to print the first 10 natural numbers using a for loop.
21. 48. Write a program to count the occurrences of each vowel in a given string.
22. 35. Write a program to find the bitwise AND, OR, and XOR of two numbers.
23. 30. Write a program to find the XOR of two binary numbers.
24. 49. Write a program to print the binary representation of numbers from 1 to 10.
25. 42. Write a program to find the dot product of two vectors.
26. 29. Write a program to check if a binary number is a palindrome.
27. 33. Write a program to swap two numbers using bitwise XOR.
28. 15. Write a program to check if a number is a prime number.
29. 14. Write a program to generate a multiplication table for a given number.
30. 39. Write a program to check if an array is sorted in ascending order.
31. 7. Write a program to check whether a number is even or odd.
32. 16. Write a program to print a pyramid pattern of stars.
33. 43. Write a program to sort a vector in descending order.
34. 10. Write a program to check if a number is positive, negative, or zero.
35. 18. Write a program to print an inverted right triangle pattern of numbers.
36. 4. Write a program to print the size of various data types in your programming language.
37. 3. Write a program to check if a given number is an integer or a floating-point number.
38. 50. Write a program to generate all prime numbers less than a given number.
39. 24. Write a function to find the sum of digits of a number.
40. 20. Write a program to print a hollow square pattern.
41. 28. Write a program to count the number of 1's in the binary representation of a number.
42. 31. Write a program to toggle the bits of an integer.
43. 47. Write a program to implement a calculator using functions.
44. 23. Write a function to calculate the nth Fibonacci number.
45. 40. Write a program to merge two sorted arrays into a single sorted array.
46. 27. Write a program to perform binary addition of two numbers.
47. 8. Write a program to determine if a year is a leap year.
48. 12. Write a program to calculate the factorial of a number using a while loop.
49. 13. Write a program to reverse a number using a loop.
50. 38. Write a program to reverse an array.