BIT102 C Programming

C Programming TU Board 2079 question paper

12 questionsSit this paper (timed)

Tribhuvan University

Bachelor of Information Technology

Semester 1 · TU Board 2079

Course Title: C Programming (BIT102)

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

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

Group A

Attempt any Two questions.(2 × 10 = 20)

  1. 1.

    List the advantages and disadvantages of global variable. Assume the two data files "num1.txt" and "num2.txt" containing integers. Merge these two files to the third file named " file3.txt". Here, the integers of " file3.txt" must be written in sorted order.

    10
  2. 2.

    How nested Structure is defined and initialized? Explain with an example. Write a program, using structure, to input records of 10 students. Members include name, roll number, marks obtained in math, C program and English. Display the records of students who have passed in C Program.

    10
  3. 3.

    When do we use for loop and while loop? Compare the while and do while loop with suitable example. Write a program to find average, minimum and maximum age in a class of 20 students.

    10

Group B

Attempt any Eight questions(8 × 5 = 40)

  1. 4.

    What do you mean by Flowchart? Draw a Flowchart to find the largest among three numbers entered by user.

    5
  2. 5.

    Why array and pointer is similar? Write a program to show the similarity between an array and pointer.

    5
  3. 6.

    Write a program to find the sum of diagonal elements of n × n matrix.

    5
  4. 7.

    How keyword is different from Variables? Discuss Basic data types with its ranges.

    5
  5. 8.

    What is operator associativity? Explain conditional and Logical operators in brief.

    5
  6. 9.

    Write a program with a function that takes an array as an argument and returns its sum to the main function.

    5
  7. 10.

    How do you include a file to another file? Illustrate with an example.

    5
  8. 11.

    Write a program to display the following pattern using the string "NEPAL" N NE NEP NEPA NEPAL

    5
  9. 12.

    Write short notes on: a. Macro vs Function b. Break vs Continue

    5

— The End —