C LAB QUESTIONS
C LAB QUESTIONS
7. Write a program to input a number (1 to 7) and print the corresponding day of the week
using a switch-case statement.
12. Write a program to find the sum of digits of a given number using a while loop.
**
***
****
***
**
12
123
16. Write a function to calculate the area of a circle given its radius.
22. Write a program to find the largest and smallest elements in an array.
25. Write a program to search for a given element in an array using linear search.
29. Write a program to define a structure for a student containing fields like name, roll number,
and marks. Input and display the details of 5 students.
30. Write a program to define a structure for a book containing fields like title, author, and price.
Input and display the details of 3 books.