Bsc Csit Nepal

2075

C Programming

Full Marks: 60
Pass Marks: 24
Time: 3 hours

Attempt any two questions: (2 x 10 = 20)

  1. What is looping statement? Discuss different looping statements with suitable example of each. (2+8)
  2. Define array? What are the benefits of using array? Write a program to add two matrices using array. (1+2+7)
  3. Why do we need data files? What are the different file opening modes? Write a program that reads data from a file “input.txt” and writes to “output.txt” file.

Attempt any eight questions: (8 x 5 = 40)

  1. Discuss different logical operators in detail.
  2. What is break statement? Discuss with example. How the break statement is different from continue statement?
  3. Write a program to check whether a number entered is even or odd.
  4. Write a program to calculate sum of first 10 odd numbers.
  5. What is preprocessor directive? Discuss # define directive with example.
  6. Discuss any five string library functions.
  7. What is dynamic memory allocation? Discuss the use of malloc() in dynamic memory allocation with example.
  8. What is structure? Create a structure rectangle with data members length and breadth.
  9. Write short notes on: