PIC QBank Unit3 4
PIC QBank Unit3 4
Programming in C (231406)
Unit 3
1. Explain the classification of data types in C.
2. Define array. List its type.
3. Define array. Write syntax to declare one dimensional array.
4. Explain Array. State two advantages of array.
5. Explain multidimensional array. Write syntax to declare two dimensional array.
6. Illustrate initialization of one dimensional array with example.
7. Define array and explain how elements of array can be accessed.
8. State the difference between one dimensional and two dimensional arrays.
9. Write a program to read and display one dimensional array.
10. Write a program to display sum and average of elements of one dimensional
array.
11. Write a program to find smallest element in an array.
12. Write a program to find largest element in an array.
13. Write a program to search the number entered by the user in one dimensional
array.
14. Write a C program to search a particular roll number in an array. If that roll no.
exist in an array print “number is present" else print “number is absent".
15. Write the program to accept 10 (ten) numbers from user using array, search and
print the location of a given number.
16. Write a program to accept 10 numbers in array and arrange them in ascending
order.
17. Differentiate between character array and integer array with respect to size and
initialization.
18. Write a program to read and display two dimensional array (matrix).
19. Explain how to initialize two dimensional array with example.
20. Write a program to calculate and print sum of two matrices (Two dimensional
array).
21. Write a program to calculate and print multiplication of two matrices (Two
dimensional array).
22. Write a program to print transpose of the matrix.
23. Write a program to print sum of diagonal elements of matrix.
1
24. Define string. Write syntax for declaration of string.
25. Differentiate between array and string.
26. State the ways of declaration and initialization of string variables.
27. Explain any four(4) string handling functions with syntax and example.
28. Explain the following string handling functions with syntax and example.
i)strlen ii)strcpy iii)strcat iv)strcmp v)strlwr vi)strrev
29. Write a program to use following String functions.
i)strlen ii)strcpy iii)strcat iv)strcmp
30. Write a program to read two strings and find whether they are equal or not.
31. Write a C program to count the number of characters and print the vowels present
in entered text.
32. Write a program to calculate length of given string without using strlen function.
33. Write a ‘C’ program to copy one string into another without using strcpy
function.
34. Write a program to concatenate two strings.
35. Define structure.
36. Declare a structure student with element roll-no and name.
37. Define structure. Give one example of structure declaration.
38. Write the syntax for structure declaration.
39. Give syntax of declaration and initialization of structure.
40. Explain how structure can be initialized with suitable example.
41. Write a program to declare structure student having elements rollno, name &
marks. Accept & display data for 3 students.
42. Write a program to read, display the information about employees using
structure(consider suitable information).
43. Explain the concept of array of structure with example.
44. Write a ‘C’ program to declare a structure ‘product’ with members as product id,
name and price. Accept and display data for one product.
45. Write a program to declare structure book having data member as book_name,
book_id, book_price. Accept this data for 10 books and display it.
46. Declare a structure circle containing data members as radius, area, perimeter.
Accept radius for one circle from user and find out perimeter and area.
47. Write a program to declare structure employee having data member name, age
and city. Accept data for three employees and display it.
48. Write a C program to declare structure employee having data member name, age,
designation and salary. Accept and display information of 1 employee.
2
Unit 4
1. Define function and list its types.
2. State any two advantages of function.
3. List and explain types of function.
4. Explain built in function.
5. Explain user defined function.
6. Enlist any two mathematical library functions with their use.
7. List any two string handling functions with their use.
8. State the syntax & use of strlen ( ) & strcat ( ) function.
9. Explain the use of the following function with syntax : i) Strcmp() ii) Strlen()
10. Write syntax and use of POW ( ) function and header file.
11. List any two input/output functions with their syntax.
12. List any two library functions with syntax.
13. Clarify the situation: when a function returns a value that does not match with the
return type of function?
14. Give syntax of declaring user defined function. Give one example.
15. Write a program to find area of circle using user defined function.
16. Write a program to calculate nth power of a number using user defined function.
17. Write a program to reverse the number 1234 (i.e. 4321) using user defined
function.
18. Write a program to calculate factorial of a number using user defined function.
19. Write a program to create user defined function to find sum of digits of a number.
20. Write a program to create user defined function to print Fibonacci series.
21. Explain passing array as an argument to the function with suitable example.
22. Explain passing string as an argument to the function with suitable example.
23. Explain passing structure as an argument to the function with suitable example.
24. Explain recursion with example.
25. Explain recursive function with suitable example.
26. Write a program to calculate factorial of a number using recursive function.
27. Write a program to calculate sum of n natural numbers using recursive function.
28. Write a ‘C’ program to generate Fibonacci series for a given number using
recursion.