Practice 100 C# Conditional Statements Programming Questions
Q1. Write a C# program to check whether a given number is positive or negative.
Input: num = 5
Output: Positive
Q2. Write a C# program to check if a number is divisible by 2.
Input: num = 8
Output: Divisible by 2
Q3. Write a C# program to check if a number is divisible by both 3 and 5.
Input: num = 15
Output: Divisible by both 3 and 5
Q4. Write a C# program to check if a number is even or odd.
Input: num = 7
Output: Odd
Q5. Write a C# program to check if a number is greater than, less than, or equal to 10.
Input: num = 10
Output: Equal to 10
Q6. Write a C# program to check if a given year is a leap year or not.
Input: year = 2024
Output: Leap year
Q7. Write a C# program to check if a given number is a multiple of 4.
Input: num = 12
Output: Multiple of 4
Q8. Write a C# program to find the largest of three numbers.
Input: a = 5, b = 10, c = 15
Output: 15
Q9. Write a C# program to check if a number is positive, negative, or zero.
Input: num = -5
Output: Negative
Q10. Write a C# program to check if a number is divisible by 2 or 3.
Input: num = 9
Output: Divisible by 3
Q11. Write a C# program to check if a number is within a given range.
Input: num = 25, range = 20 to 30
Output: Within the range
Q12. Write a C# program to check if a number is between 10 and 20.
Input: num = 15
Output: Between 10 and 20
Q13. Write a C# program to check if a number is less than or equal to 10.
Input: num = 5
Output: Less than or equal to 10
Q14. Write a C# program to check if a number is equal to 100.
Input: num = 100
Output: Equal to 100
Q15. Write a C# program to check if a number is divisible by 5 or 10.
Input: num = 50
Output: Divisible by 5 and 10
Q16. Write a C# program to find if the entered number is prime or not.
Input: num = 7
Output: Prime
Q17. Write a C# program to check if a number is divisible by both 4 and 6.
Input: num = 24
Output: Divisible by both 4 and 6
Q18. Write a C# program to check if a number is divisible by 2 but not 4.
Input: num = 6
Output: Divisible by 2 but not by 4
Q19. Write a C# program to check if a number is even and greater than 10.
Input: num = 12
Output: Even and greater than 10
Q20. Write a C# program to check if a number is positive and even.
Input: num = 8
Output: Positive and even
Q21. Write a C# program to check if a number is negative or zero.
Input: num = -5
Output: Negative
Q22. Write a C# program to print a message if a number is zero.
Input: num = 0
Output: Number is zero
Q23. Write a C# program to check if a character is an alphabet or not.
Input: char = 'A'
Output: Alphabet
Q24. Write a C# program to check if a character is a vowel or consonant.
Input: char = 'E'
Output: Vowel
Q25. Write a C# program to find the smallest of three numbers.
Input: a = 10, b = 5, c = 15
Output: 5
Q26. Write a C# program to check if a number is divisible by both 5 and 7.
Input: num = 35
Output: Divisible by both 5 and 7
Q27. Write a C# program to check if a number is divisible by 3, 5, or 7.
Input: num = 21
Output: Divisible by 3 and 7
Q28. Write a C# program to check if a number is even and less than 10.
Input: num = 8
Output: Even and less than 10
Q29. Write a C# program to check if a number is odd and greater than 20.
Input: num = 21
Output: Odd and greater than 20
Q30. Write a C# program to check if a number is a perfect square.
Input: num = 16
Output: Perfect square
Q31. Write a C# program to check if a number is a palindrome.
Input: num = 121
Output: Palindrome
Q32. Write a C# program to check if a number is prime or even.
Input: num = 13
Output: Prime
Q33. Write a C# program to check if a number is positive and odd.
Input: num = 11
Output: Positive and odd
Q34. Write a C# program to check if a number is divisible by 2, 3, or 5.
Input: num = 15
Output: Divisible by 3 and 5
Q35. Write a C# program to check if a number is divisible by 10.
Input: num = 30
Output: Divisible by 10
Q36. Write a C# program to check if a number is divisible by both 4 and 5.
Input: num = 20
Output: Divisible by both 4 and 5
Q37. Write a C# program to check if a number is greater than 50 and even.
Input: num = 60
Output: Greater than 50 and even
Q38. Write a C# program to check if a number is less than 100 and odd.
Input: num = 99
Output: Less than 100 and odd
Q39. Write a C# program to check if a number is a multiple of both 2 and 5.
Input: num = 10
Output: Multiple of 2 and 5
Q40. Write a C# program to check if a number is divisible by 3, but not 5.
Input: num = 9
Output: Divisible by 3 but not by 5
Q41. Write a C# program to check if a number is a multiple of 6.
Input: num = 12
Output: Multiple of 6
Q42. Write a C# program to check if a number is within the range of 1 to 100.
Input: num = 50
Output: Within the range
Q43. Write a C# program to check if a number is divisible by 7 and not by 5.
Input: num = 14
Output: Divisible by 7 and not by 5
Q44. Write a C# program to check if a number is negative or divisible by 3.
Input: num = -9
Output: Negative or divisible by 3
Q45. Write a C# program to check if a number is greater than 10 or less than 20.
Input: num = 15
Output: Greater than 10 or less than 20
Q46. Write a C# program to check if a number is divisible by 2 or 7.
Input: num = 14
Output: Divisible by 2 or 7
Q47. Write a C# program to check if a number is divisible by 3, but not divisible by 6.
Input: num = 9
Output: Divisible by 3 but not by 6
Q48. Write a C# program to check if a character is a digit.
Input: char = '5'
Output: Digit
Q49. Write a C# program to check if a number is odd and less than 20.
Input: num = 15
Output: Odd and less than 20
Q50. Write a C# program to check if a number is positive and divisible by 5.
Input: num = 25
Output: Positive and divisible by 5
Q51. Write a C# program to check if a number is even and divisible by 5.
Input: num = 10
Output: Even and divisible by 5
Q52. Write a C# program to check if a character is a lowercase letter.
Input: char = 'g'
Output: Lowercase letter
Q53. Write a C# program to check if a character is an uppercase letter.
Input: char = 'T'
Output: Uppercase letter
Q54. Write a C# program to check if a number is divisible by 4, but not by 2.
Input: num = 8
Output: Divisible by 4 but not by 2
Q55. Write a C# program to check if a number is divisible by both 3 and 9.
Input: num = 27
Output: Divisible by both 3 and 9
Q56. Write a C# program to check if a number is less than or equal to zero.
Input: num = -3
Output: Less than or equal to zero
Q57. Write a C# program to check if a number is greater than 10 and odd.
Input: num = 15
Output: Greater than 10 and odd
Q58. Write a C# program to check if a number is divisible by both 3 and 6 but not 9.
Input: num = 18
Output: Divisible by both 3 and 6 but not 9
Q59. Write a C# program to check if a number is a multiple of 5 and even.
Input: num = 10
Output: Multiple of 5 and even
Q60. Write a C# program to check if a number is divisible by 3, 5, and 7.
Input: num = 105
Output: Divisible by 3, 5, and 7
Q61. Write a C# program to check if a number is between 50 and 100 (inclusive).
Input: num = 60
Output: Between 50 and 100
Q62. Write a C# program to check if a number is a positive, negative, or zero.
Input: num = 0
Output: Zero
Q63. Write a C# program to check if a number is divisible by 7 but not 3.
Input: num = 14
Output: Divisible by 7 but not by 3
Q64. Write a C# program to check if a number is divisible by 6 and 10.
Input: num = 60
Output: Divisible by 6 and 10
Q65. Write a C# program to check if a number is divisible by 5 or 11.
Input: num = 55
Output: Divisible by 5 or 11
Q66. Write a C# program to check if a number is greater than 100 and divisible by 5.
Input: num = 150
Output: Greater than 100 and divisible by 5
Q67. Write a C# program to check if a number is divisible by 5 and 7, but not 3.
Input: num = 35
Output: Divisible by 5 and 7 but not 3
Q68. Write a C# program to check if a character is a digit or not.
Input: char = '9'
Output: Digit
Q69. Write a C# program to check if a number is divisible by 10 but not by 2.
Input: num = 20
Output: Divisible by 10 but not by 2
Q70. Write a C# program to check if a number is divisible by both 2 and 9.
Input: num = 18
Output: Divisible by both 2 and 9
Q71. Write a C# program to check if a number is divisible by 7 but not by 2.
Input: num = 14
Output: Divisible by 7 but not by 2
Q72. Write a C# program to check if a number is divisible by 6 but not by 3.
Input: num = 12
Output: Divisible by 6 but not by 3
Q73. Write a C# program to check if a number is divisible by 9 and 4.
Input: num = 36
Output: Divisible by 9 and 4
Q74. Write a C# program to check if a number is divisible by 7 or 10.
Input: num = 70
Output: Divisible by 7 or 10
Q75. Write a C# program to check if a number is greater than 100 or less than 10.
Input: num = 5
Output: Less than 10
Q76. Write a C# program to check if a character is a letter and not a number.
Input: char = 'A'
Output: Letter
Q77. Write a C# program to check if a number is divisible by 11 or 13.
Input: num = 26
Output: Divisible by 11
Q78. Write a C# program to check if a number is divisible by 2, 5, and 7.
Input: num = 70
Output: Divisible by 2, 5, and 7
Q79. Write a C# program to check if a number is greater than 50 but not divisible by 5.
Input: num = 60
Output: Greater than 50 and divisible by 5
Q80. Write a C# program to check if a number is divisible by 4 but not 8.
Input: num = 12
Output: Divisible by 4 but not 8
Q81. Write a C# program to check if a number is divisible by 7 but not by 11.
Input: num = 14
Output: Divisible by 7 but not 11
Q82. Write a C# program to check if a character is an uppercase vowel.
Input: char = 'A'
Output: Uppercase vowel
Q83. Write a C# program to check if a number is divisible by 2, 5, or 10.
Input: num = 20
Output: Divisible by 2, 5, or 10
Q84. Write a C# program to check if a character is a special character.
Input: char = '#'
Output: Special character
Q85. Write a C# program to check if a number is divisible by 5 but not by 2.
Input: num = 15
Output: Divisible by 5 but not by 2
Q86. Write a C# program to check if a number is divisible by both 5 and 10, but not by 2.
Input: num = 25
Output: Divisible by 5 and 10 but not by 2
Q87. Write a C# program to check if a character is a digit between 0 and 5.
Input: char = '3'
Output: Digit between 0 and 5
Q88. Write a C# program to check if a number is divisible by 8 or 3.
Input: num = 24
Output: Divisible by 8 or 3
Q89. Write a C# program to check if a number is divisible by both 2 and 7, but not by 5.
Input: num = 14
Output: Divisible by both 2 and 7 but not by 5
Q90. Write a C# program to check if a number is divisible by 6, 9, and 10.
Input: num = 90
Output: Divisible by 6, 9, and 10
Q91. Write a C# program to check if a character is a digit or letter.
Input: char = 'A'
Output: Letter
Q92. Write a C# program to check if a number is a multiple of 12 and not 5.
Input: num = 24
Output: Multiple of 12 but not 5
Q93. Write a C# program to check if a number is divisible by both 4 and 6, but not 3.
Input: num = 12
Output: Divisible by both 4 and 6 but not 3
Q94. Write a C# program to check if a number is divisible by 4, 5, or 6.
Input: num = 20
Output: Divisible by 4, 5, or 6
Q95. Write a C# program to check if a number is divisible by 10 but not 2.
Input: num = 30
Output: Divisible by 10 but not 2
Q96. Write a C# program to check if a number is even and divisible by 3.
Input: num = 6
Output: Even and divisible by 3
Q97. Write a C# program to check if a character is a digit between 6 and 9.
Input: char = '7'
Output: Digit between 6 and 9
Q98. Write a C# program to check if a number is divisible by both 3 and 5 but not 7.
Input: num = 15
Output: Divisible by 3 and 5 but not 7
Q99. Write a C# program to check if a character is a vowel or consonant.
Input: char = 'O'
Output: Vowel
Q100. Write a C# program to check if a number is divisible by 2, 3, and 4.
Input: num = 12
Output: Divisible by 2, 3, and 4
Bikki Singh
Hi, I am the instructor of TechnoVlogs. I have a strong love for programming and enjoy teaching through practical examples. I made this site to help people improve their coding skills by solving real-world problems. With years of experience, my goal is to make learning programming easy and fun for everyone. Let's learn and grow together!