You are on page 1of 3

Second Assignment of C

Q1. What is an array ? Write the syntax for single and double dimension array declaration
and write an example of each.

Q2. Write a program to input 10 numbers an array and display in reverse order.

Q3. Write a program to input 20 numbers into an array and find out the second smallest and
largest number(LAB)

Q4. Write a program to input N numbers into an array and find out the average value of them.
(LAB)

Q5. WAP input numbers into a matrix 5x4 and find out the sum of each element. (LAB)

Q6. WAP for matrix addition . (LAB)

Q7. WAP for matrix multiplication. (LAB)

Q8. WAP for matrix transpose. (LAB)

Q9. WAP to input N numbers into an array and find the square root of each number and
display. (LAB)

Q10. WAP program for number sorting in descending order. (LAB)

Q11. WAP for name sorting in descending order. (LAB)

Q13. What is function? Differentiate between user define function and library function.

Q14. Differentiate between call by value and call by reference function with an example.

Q15. What do mean by storage classes? Explain each of them.

Q16. Write a program using function to find out the quadratic equation. (LAB)

Q17. Write a program to sort the numbers in ascending order by using user define function
with passing array into function. (LAB)

Q18. What do mean by prototype function? Explain the type of user define function.

Q19. Write a program to find out the matrix addition using user define function. (LAB)

Q20. What is pointer? Explain the application of pointers.


Q22. What do mean by dynamic memory allocation? Explain with an example.

Q23. WAP to access the element of an array using pointer.

Q24. What is pointer to pointer? Write a program to sort few numbers in ascending order
using dynamic memory allocation. (LAB)

Q25. Explain the following funcitons: malloc(), calloc(), and free() with an example.

Q26. What is structure and union? Differentiate between structure, union and array.

Q27. Explain the nested structure with an example.

Q28. What do mean by array of structure? WAP to read 20 employees name and address and
sort them in ascending order based on name using structure. (LAB)

Q29. WAP to define the structure of employee having data members name, age, address and
salary. Take the data of N employees and display using dynamically allocated memory
and also display average salary. (LAB)

Q30. What is file? Explain the file open modes.

Q31. What do mean by sequential file and random file handling? Explain with an example.

Q32. Write a program to read N students records like as student id, name, address and store
into a file called student.txt. (LAB)

Q33. Write a program to read the contents from above created file student.txt and display.
(LAB)

Q34. Write a program to read N employees records as id, name and salary from the keyboard
and store into a file called “employee.txt” and read the contents from the same file and
display whose salary is between 20000 to 50000. (LAB)

Q35. Write a program to read N employees records as id, name and city from the keyboard and
store into a file called “employee.txt” and read the contents from the same file and
display whose city name is “chitwan” or “Kathmandu”. (LAB)

36. Write a c program to copy the contents from “college.txt” file to “staff.txt” file. (LAB)

37. Write a Program to calculate and display the volume of a CUBE having its height (h=10cm), width
(w=12cm) and depth (8cm).lab

38. 6. Write C program to evaluate each of the following equations. Lab


39. Write a program to find the roots of quadratic equation. Lab

40. Write a program to check number is Armstrong or not. (Hint: A number is Armstrong if the sum of
cubes of individual digits of a number is equal to the number itself).

41. Write a program to check whether the entered year is leap year or not (a year is leap if it is divisible
by 4 and divisible by 100 or 400.) lab

42. Write a program to find GCD (greatest common divisor or HCF) and LCM (least common multiple) of
two numbers. Lab

43. write a c program to generate the following pattern LAB

44. . Write a program to accept a string and count the number of vowels present in this string.lab

45. Write a program to generate Fibonacci series using recursive function. LAB

46. Write a program to find sum of digits of the number using Recursive Function.LAB

47. . Write a C program to find power of any number using recursion.LAB

48. . Write a program to compare two strings using pointers.lab

You might also like