8
8
8
Write a program to input length and width of a rectangle and calculate perimeter and area of the
rectangle.
9. Write a program to input radius of a circle from user and find diameter, circumference and area
of the circle.
10. Write a program to input a positive integer N with 2 digits from the keyboard, output to the
screen the sum of the digits of N.
11. Write a program to input temperature in degrees Celsius and convert to Fahrenheit, using the
conversion formula:
12. Write a program that allows input hours, minutes and seconds and convert it to seconds and
print the result.
13. Write a program in C that takes minutes as input, and display the total number of hours and
minutes
14. Write a program to input number of days from user and convert it to years, weeks and days.
Output: Years: 1
Weeks: 1
Days: 1
15. Write a program to enter length in centimeter and convert it into meter and kilometer.
16. Write a program to calculate the perimeter and area of shapes: triangles, squares, rectangles
and circles with the information that needs to be entered from the keyboard.
17. Write a program to enter two integers a and b. Print the maximum value to the screen.
18. Write a program to check whether an integer entered number by the user is odd or even.
20. Write a program to find the largest number among three number.
20b. Write a program to enter two integers a,b and c. Print the maximum value to the screen.
21. Write a program input three numbers a,b,c. Print to the screen in ascending order of numbers.
22. Write a program to find input two numbers a, b. Find the largest number using Conditional
Operator.
23. Write a C program to find whether a given year is a leap year or not.
(A leap year is a year that is divisible by 4 and not by 100. Or it is divisible by 400)
23b. Write a C program to find whether a given year is a leap year or not.
(A leap year is a year that is divisible by 4 and not by 100. Or it is divisible by 400)
26. Write a program to read temperature in centigrade and display a suitable message according to
temperature state below:
27. Write a program to input a three-digit integer n. Output to the screen in ascending order of
digits.
Ex: Enter n : 291
Output : 129
28. Write a program in C to read any day number in integer (2….8) and display day name in the
week
Ex: Input : 4
Output :Wednesday
29. Write a C program to input an alphabet and check whether it is vowel or consonant using switch
case
30. Write a C program to create menu driven calculator that performs basic arithmetic operations
(add, subtract, multiply and divide) using switch case and functions. The calculator should input two
numbers and an operator from user. It should perform operation according to the operator entered and
must take input in given format.
Output : 2.2
Ex: Enter n : 12
Output : 6
38. Write a C program to input two or more numbers from user and find maximum and minimum of
the given numbers using functions.
39. Write a C program to input a positive integer n. Find the sum of it’s divisors.
41. Write a program to input a positive integer n. Checks whether n is prime or not.
42. Write a program to input a positive integer n. Find the sum of prime less than n.
43. Write a function in C programming to find prime numbers between two intervals using function.
44. Write a program to input two positive integers a and b. Find the greatest common divisor and
least common multiple of a and b.
46. Write a program in C to convert a decimal number to a binary number using the function.
47. Write a program in C to check whether a number is “perfect numbers” or not using the function.
(Perfect numbers: a perfect number is a positive integer that is equal to the sum of its positive divisors,
excluding the number itself)
48. Write a C program to input a positive integer n. Print all “perfect numbers” less than n.