Tribhuvan University

Institute of Science and Technology

TU Exam Year: 2081

Bachelor Level: B.Sc. CSIT

Semester: First

Subject: C Programming (CSC115)

Full Marks: 60 | Pass Marks: 24

Time: 3 Hours

Candidates are required to give their answers in their own words as far as practicable.

SECTION A

Attempt all questions.

  1. 1.
    Define null character. How do you concatenate and compare two strings?
  2. 2.
    Differentiate between debugging and testing. What is the use of delimiters? Explain the different types of data types with examples.
  3. 3.
    List any three examples of unformatted I/O. Write a program to find the sum of first 5 prime numbers. The loop will continue to take input from user until the user has given five prime numbers.
  4. 4.
    Describe the task of any two graphics functions with example.
  5. 5.
    Write a program to create a function that will generate 5 random integers, store them in a static array, and return their pointer to main() function such that the elements of the array will be displayed.
  6. 6.
    What are the uses of & and * operators? List the advantages of dynamic memory allocation.
  7. 7.
    A file named NUM.DAT contains the integers and real numbers. Write a program to copy the integers only from NUM.DAT to INT.DAT.
  8. 8.
    Discuss about operator precedence and associativity with example.
  9. 9.
    Write a program to take a string in main() function and pass it to a user-defined function that will return the length of that string.
  10. 10.
    Create a structure called 'Student' with members name, age, and total marks. Write a C program to input data for two students and display the name of the student having higher total marks.
  11. 11.
    How do you scan a file randomly? When do you prefer union over structure? Justify with an example.
  12. 12.
    List any two types of bitwise operators. How do you create nested structure?