C Programming 2077

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

Section A

Long Answer Questions.

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

Official Answer
AI Generated Answer

AI is thinking...

1. Explain the role of function in programming. How function is declared, defined and called in C? Write a program to find factorial of 'n' using recursive function.

10 marks
Details
Official Answer
AI Generated Answer

AI is thinking...

2. What is an identifier and keyword? Explain the rules for naming valid identifiers in C with example. Write a C program to find sum of digits of a 'n' digit number.

10 marks
Details
Official Answer
AI Generated Answer

AI is thinking...

3. How structure is different from union? Write a program to store and display basic information (roll, name, address, email and phone) of students of using a structure.

10 marks
Details
Official Answer
AI Generated Answer

AI is thinking...

Section B

Short Answer Questions.

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

Official Answer
AI Generated Answer

AI is thinking...

4. What is the basic structure of a C program? Explain each part.

5 marks
Details
Official Answer
AI Generated Answer

AI is thinking...

5. How break statement is different from continue statement. Explain with examples.

5 marks
Details
Official Answer
AI Generated Answer

AI is thinking...

6. What do you mean by multi-dimensional array? Write  program logic to add and display the sum of two m x n matrices.

5 marks
Details
Official Answer
AI Generated Answer

AI is thinking...

7. Find errors (if any) in the following program and rewrite it.

        #define(studio.h)

        float main <>

        {

            int m[ ][ ] = ({1,2,3,4});

            for(i=4, i>=0; i--)

            for(j=0, j<4; j++);

            m[i][j] = a[i][j]+b[i][j];

            return 0.0;

        }

5 marks
Details
Official Answer
AI Generated Answer

AI is thinking...

8. Write a program to generate the following pattern of Integers.

    

5 marks
Details
Official Answer
AI Generated Answer

AI is thinking...

9. Write a C program to check whether a given string is palindrome or not.

5 marks
Details
Official Answer
AI Generated Answer

AI is thinking...

10. What is pointer? Illustrate the use of a double pointer with suitable example.

5 marks
Details
Official Answer
AI Generated Answer

AI is thinking...

11. Why file is used in programming? Explain different file opening modes.

5 marks
Details
Official Answer
AI Generated Answer

AI is thinking...

12. Write short notes on:

        a. Macros

        b. Null Pointer

5 marks
Details
Official Answer
AI Generated Answer

AI is thinking...