C Programming Model Question

Question Paper Details
Tribhuwan University
Institute of Science and Technology
Model Question
Bachelor Level / First Semester / Science
Information Technology ( BIT102 )
( C Programming )
Full Marks: 60
Pass Marks: 24
Time: 3 hours

Group A

Attempt any two questions.     [2*10=20]

Official Answer
AI Generated Answer

AI is thinking...

1. Define array. Differentiate between 1D and 2D array. Write a program that stores 100 integers in an array and display them in ascending order.

10 marks
Details
Official Answer
AI Generated Answer

AI is thinking...

2. Define structure. Write syntax for defining and initializing structure? Write a program that stores details of N employees (E_id, E_Name, Salary), and display the details of those employees whose salary is less than 10000.

10 marks
Details
Official Answer
AI Generated Answer

AI is thinking...

3. Discuss the advantages of using functions in programming. Differentiate between recursive function and normal function. Write a program using call by reference to swap the values of two variables.

10 marks
Details
Official Answer
AI Generated Answer

AI is thinking...

Group B

Attempt any eight questions.     [8*5=40]

Official Answer
AI Generated Answer

AI is thinking...

4. Define the basic structure of C program. Explain the Compilation and Execution of a C program?

5 marks
Details
Official Answer
AI Generated Answer

AI is thinking...

5. What are the uses of comments and escape sequences in a C program, explain with example?

5 marks
Details
Official Answer
AI Generated Answer

AI is thinking...

6. What are relational operators and arithmetic operators? Write a C code to check if a given number is odd or even.

5 marks
Details
Official Answer
AI Generated Answer

AI is thinking...

7. Define iterative statements. Write a program that using a loop to compute and prints the sum of squares of first 10 even natural numbers.

5 marks
Details
Official Answer
AI Generated Answer

AI is thinking...

8. How is string defined in C program? Write a program to check if a given string is a palindrome or not.

5 marks
Details
Official Answer
AI Generated Answer

AI is thinking...

9. Differentiate between switch case and else .. if ladder. Why is break statement used inside switch case? Explain briefly.

5 marks
Details
Official Answer
AI Generated Answer

AI is thinking...

10. Describe the concept of pointer and its arithmetic with suitable examples.

5 marks
Details
Official Answer
AI Generated Answer

AI is thinking...

11. Explain the syntax of fwrite() function. Write a program to create a file named "student.txt" and stores record of any five students given by user.

5 marks
Details
Official Answer
AI Generated Answer

AI is thinking...

12. Write short notes on: [2+3]

        i) Formatted input/output

        ii) C Preprocessors/directives

5 marks
Details
Official Answer
AI Generated Answer

AI is thinking...