Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
14 views

Programming Question for Students

Uploaded by

ar5629938
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

Programming Question for Students

Uploaded by

ar5629938
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Programming Fundamental

Practice Question for Students

1. Write a program in order to check either the number is positive or not, and mention
how many digits number are entered in the program.
2. Write a program in C++ to find prime number within a range.
3. Write a program to print Even or Odd of the given number.
4. Write a program in C++ to find the LCM of two numbers.
5. Write a program to display a table of user’s choice and also set limit of the table.
6. Write a program to demonstrate the use of logical AND, OR, and NOT operators by
evaluating multiple conditions
7. Create a program to calculate the average of three numbers and check if the result
is even or odd using the modulus operator.
8. Write a program to check whether a number is positive, negative, or zero using an
if-else statement.
9. Create a program to find whether a given number is even or odd using the if-else
statement.
10. Write a program to check if a number is positive, negative, or zero using if-else if
statements.
11. Write a program to determine whether a person is eligible to vote based on their
age.
12. Using nested if-else, write a program to check whether a character is a vowel,
consonant, or neither.
13. Write a program to calculate the grade of a student based on their percentage marks
using if-else if conditions.
14. Write a program to find the maximum of four numbers entered by the user using
nested if-else.
15. Write a program to input the age of a person and determine whether they are
eligible to vote (age ≥ 18) using if-else.
16. Write a program to display a menu to the user for a simple calculator (addition,
subtraction, multiplication, division). Use the switch-case statement.
17. Create a program to check whether a given year is a leap year or not using an if-
else condition.
18. Write a program to display the corresponding month name for a given number (1
for January, 2 for February, etc.) using a switch statement.
19. Extend the above program to check whether the month falls in the first half
(January to June) or the second half (July to December) of the year using a nested
switch.
20. Write a program to perform basic arithmetic operations (+, -, *, /) based on a user
input operator using a switch statement.
21. Write a program to classify a character as uppercase, lowercase, digit, or special
symbol using a switch statement.
22. Create a program using nested switch to determine the category of a vehicle (Car,
Bike, Truck) and then further classify it based on fuel type (Petrol, Diesel).
23. Write a program to concatenate two strings input by the user using the
concatenation operator (+).
24. Create a program to find the length of a string using the length () function.
25. Develop a program that reverses a string entered by the user without using any in-
built functions.
26. Write a program to print the sum of all natural numbers up to n using a for loop.
27. Write a program to print all even numbers between 1 and 100 using a for loop.
28. Write a program to calculate the factorial of a number using a while loop.
29. Write a program to find the sum of digits of a number using a do-while loop.
30. Write a program to check whether a given number is a palindrome using loops.
31. Write a program to print the Fibonacci series up to n terms using a for loop.

You might also like