0% found this document useful (0 votes)
2 views2 pages

C Programming Questions

Uploaded by

NEPOP KNG
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views2 pages

C Programming Questions

Uploaded by

NEPOP KNG
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

C Programming Questions

1. Write a program to print your name and age.

2. Write a program to input two numbers and print their sum.

3. Write a program to find the area of a rectangle.

4. Write a program to convert temperature from Celsius to Fahrenheit.

5. Write a program to read and print an integer, a float, and a character.

6. Write a program to find the perimeter of a circle using radius.

7. Write a program to perform all arithmetic operations on two numbers.

8. Write a program to compute simple interest (SI = P*T*R/100).

9. Write a program to find the square and cube of a number.

10. Write a program to calculate the average of three numbers.

11. Write a program to convert days into years, weeks, and days.

12. Write a program to demonstrate pre-increment and post-increment.

13. Write a program to show the difference between i++ and ++i in an expression.

14. Write a program to evaluate: a = 5; b = a++ + ++a;

15. Write a program to check the final value of i in i = 1; i = i++ + i;

16. Write a program to check if a number is greater than 10.

17. Write a program to compare two numbers and print the greater one.

18. Write a program to check whether a number is even or odd.

19. Write a program to check if a person is eligible to vote (age >= 18).

20. Write a program to check if a number is positive, negative, or zero.

21. Write a program to check if a number is divisible by both 3 and 5.

22. Write a program to check if a character is a vowel or not.

23. Write a program to check if a number is in the range 100 to 999.

24. Write a program to check if a year is a leap year.

25. Write a program to input marks of three subjects and check if the student passed in all.
26. Write a program to find the maximum of two numbers using the conditional operator.

27. Write a program to find the minimum of two numbers using the conditional operator.

28. Write a program to check even or odd using the conditional operator.

29. Write a program to check if a number is positive or negative using the conditional operator.

30. Write a program to find the greatest of three numbers using nested conditional operators.

31. Write a program to swap two numbers (without using a third variable).

32. Write a program to calculate total and average marks of five subjects.

33. Write a program to check whether a character is an alphabet or a digit.

34. Write a program to compute the gross salary given basic salary (gross = basic + 20% of basic).

35. Write a program to find the remainder and quotient when one number is divided by another.

36. What will be the output of: int a = 5; printf("%d", a++ + ++a);

37. Predict the output: int x = 10; x = x++ + ++x; printf("%d", x);

38. What is the output of: int x = 5; int y = 10; int z = (x > y) ? x : y; printf("%d", z);

39. Output? int a = 10; int b = 20; printf("%d", (a < b) && (b > 15));

40. What is the output of: int a = 7; printf("%d", a % 2 == 0 ? 100 : 200);

You might also like