C Assignment practice question | Level 1

BASIC TO ADVANCED C PROGRAMS 

1. Print your name using printf.

2. Print an integer variable using %d.

3. Print a float variable using %f.

4. Print a character variable using %c.

5. Take an integer input and print it.

6. Take a float input and print it.

7. Take a character input and print it.

8. Add two integers and print the result.

9. Subtract two integers and print the result.

10. Multiply two integers and print the result.

11. Divide two float numbers and print the result.

12. Use modulus operator to find remainder of two integers.

13. Print ASCII value of a character.

14. Add two float numbers and print the result.

15. Declare int, float, and char variables and print them using formatted output.

16. Demonstrate use of increment operator (++) on an integer.

17. Demonstrate use of decrement operator (--) on an integer.

18. Take input of two integers and print their average (as float).

19. Multiply an integer and a float and print the result.

20. Assign a character to a variable and print its ASCII using %d.

21. Store a float number and print it with 2 decimal precision using %.2f.

22. Take two floats and calculate the result of: ((a + b) * 2.5) / 3.0

23. Print a character, its ASCII, and the next character by adding 1.

24. Demonstrate multiple scanf inputs in one line (int, float, char) and print them.

25. Multiply two float values and store result in an integer (type casting).

26. Take radius (float) and calculate area of circle (πr²) using 3.14.

27. Assign values to variables using expression x = a + b * c and print result.

28. Convert temperature from Celsius to Fahrenheit using the formula F = (C * 9/5) + 32.

29. Print formatted output with tabs (\t) and newlines (\n).

30. Demonstrate assigning value of one variable to another and print both.




Comments