Elective Programming In C

Programming In C PU Spring question paper

6 questionsSit this paper (timed)

Pokhara University

Bachelor of Engineering in Computer Engineering

Semester 1 · PU Spring

Course Title: Programming In C

Full Marks: 100Pass Marks: 45Time: 3 hrs.

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

  1. 2.
    • a) What are formatted input/output functions? Explain with examples.
    • b) Define datatypes. Explain basic data types with examples.
    15
  2. 3.
    • a) Explain any two conditional statements in detail with syntax and flowchart.

    OR

    Write a program to find the n" term of a Fibonacci series 0, 1,.1,.2, 3, Sy...

    • b) Write a program that prompts the user to enter n numbers from the keyboard, find the sum of even numbers and display the sum.
    15
  3. 4.
    • a) What are the advantages of using array in programming? Explain different ways to initialize one dimensional array with examples.

    OR

    Write a program to find the product of two mxn and nxm matrices and display the resulted matrix.

    • b) Explain Formal arguments and Actual arguments with an example program.
    15
  4. 5.
    • a) Using user defined function write a program to input n numbers inan one dimensional array and find the average of the numbers,
    • b) What do you understand by pointer? Explain pointer arithmetic in brief,
    15
  5. 6.
    • a) Create a structure with the following data fields: pereaay piecay R )_R [ron [| same [aston | sat [a Input records of 100 employee and display the record of those employee whose address is “Kathmandu”.
    • b) Why do we need file pointer? Explain different file opening modes.
    15
  6. 7.

    Write short notes on: (Any two) 2%5

    • a) Storage Class
    • b) Recursive function
    • c) — malloc( ), calloc( ) and free() Wa = j
    4

— The End —