PRATICAL FILE ASSIGNMENT QUESTIONS
1. WAP to input two numbers and perform addition, subtraction, multiplication, division, and modulus using
arithmetic operators.
2. WAP to check whether a given number is greater than, less than, or equal to another number using relational
operators.
3. WAP to demonstrate the use of assignment operators (=, +=, -=, *=, /=, %=) by updating the value of a
variable step by step.
4. WAP to demonstrate the difference between pre-increment (++a) and post-increment (a++) operators.
5. WAP to input two integers and perform bitwise AND (&), OR (|), XOR (^), and NOT (~) operations.
6. Write a program to check divisibility of a number by 5&7.
7. Write a program in C to check whether a number is small, medium, or large using an if-else ladder.
8. Write a C program to determine the grade of a student based on marks using an if-else ladder.
9. Write a program in C to display the day of the week based on a number (1–7) using an if-else ladder.
10. Write a C program to check whether there is a profit or a loss based on cost price and selling price.
11. Write a program in C to check the condition of temperature (e.g., hot, cold, normal) .
12. Write a C program to check whether a character is a vowel or a consonant.
13. Write a simple calculator program in C using an if-else ladder to perform basic operations (+, −, , /).
14. Write a C program to check whether a number is positive, negative, or zero using nested if statements.
15. Write a program to input marks of 5 subjects and calculate total marks and percentage.
16. Write a program to convert days into years, weeks, and remaining days.
17. Write a program to separate a 5-digit number into individual digits.
18. Write a program to reverse a 3-digit number (e.g., 123 becomes 321).
19. Write a program to interchange the values of two variables without using third variable (using arithmetic
operations).
20. Input an uppercase alphabet (A–Z) and use switch to print its ASCII value.
21. Write a program to find all prime numbers between 1 to N.
22. Write a program to find GCD (Greatest Common Divisor) of two numbers.
23. Write a program to find LCM (Least Common Multiple) of two numbers.
24. Write a program to print all factors of a given number.
25. Write a program to sort an array using pointers (any sorting method).
26. Write a program to find all duplicate elements in an array.
27. Write a program to merge two arrays into a third array.
28. Write a C program using a while loop to print numbers from 1 to 10..
29. Write a C expression to find the largest among three numbers using the ternary operator.
30. Write a C program to find the factorial of a number using recursion.
31. Write a program to check whether a number is an Armstrong number or not.
32. Write a program that stops printing numbers when 7 is reached using break.
33. Write a program to insert and delete an element in a 1D array.
34. Swapping of numbers
35. Program to Calculate Area and Circumference of a Circle
36. Program to Find the Square and Cube of a Number
37. Program to Find the Sum of Digits of a Number
38. Program to Check Whether a Number is Palindrome
39. Program to Print All Even Numbers Between Two Given Numbers
40. Write a C program to check whether a student passes or fails the exam.
(Condition: pass if marks ≥ 40)
41. Write a program to check if a number is even and also divisible by 5 using logical operators.
42. Write a program to find the absolute value of any number entered by the user (convert negative number to
positive) using if-else.
43. Write a program to input the ages of three persons and find out who is youngest using nested if-else.
44. Write a program to check whether three angles can form a valid triangle.
(Hint: Sum of angles = 180°)
45. Write a program to check whether a number is even or odd using bitwise AND (&) instead of modulus.
46. Write a program to convert Indian Rupees to Dollars (Assume 1 USD = 83 INR) using arithmetic operators.
47. Input month number (1–12) and print how many days that month has using switch.
48. Write a program to check whether a number is prime or not using a loop.
49. Write a program to check whether a number is a palindrome using a loop.
50. Write a program to find the smallest element in an array.