Model question of Computer Programming | B. Sc Year: III

Model question

Tribhuvan University

Bachelor Level / IV year/  Sc. & Tech.                                                                                 Full Marks: 60

Computer Programming (Math 404)                                                                                    Time: 2 Hours

 

Attempt all Questions. All Questions carry equal marks.

 

1. What is the use of CPU in a computer system? How it work? How variables in a c-program can be defined? Support your answer by writing a c-program containing declaration and definition of variables.                  [2+3+5]

[Unit 1 and Unit 3]

 

2. Why language processor is needed? Differentiate compilers from interpreters. Write a program to capture inputs and display outputs for variables name, address and roll_number. Use different escape sequence characters for displaying the formatted output.      

                                                                                                                                                        [2+3+5]

[Unit 2 and Unit 4]

 

3. Define the different types of logical operators used in C. Write a program using function for calculating total distance travelled by a vehicle in t seconds, where the distance is given by the expression  distance = ut + (at2) / 2

The program should provide flexibility to capture inputs for the variables u (initial velocity), a

            (acceleration) and the time (t).                                                                                                    [4+6]

[Unit 5 and Unit 7]

 

4. What is the difference between the while and do while statements? How continue statement can be used in while loop? How fopen and fclose statements can be used in file handling? 

                                                                                                                                                        [4+2+4]

[Unit 10 and unit 6]

 

5. What is a pointer? How pointer is initialized? Write a program to read two arrays, add the two arrays and store the result in third array. Print the final output of the third array. Label your program with proper comments.                 [2+2+6]

[Unit 8]

 

6. Discuss about the possible approaches for passing arguments to a function.  How structure differs from union? How can you create array of structures?                                                                       [4+4+2]

 

OR

 

Define function category with parameters and return value. How recursion works? Illustrate with suitable example. How self-referential structures can be defined?       [2.5+2.5+5] [Unit 7 and 9]

 

Netra Koirala

Netra Koirala

Computer Science Educator

Passionate computer science educator and author. Provides free study notes, practical guides, and tutorials for Class 9, 10, 11, 12, and B.Sc CSIT students in Nepal. Years of teaching experience in computer science fundamentals.

Computer Science notes, tutorials, MCQs, and educational resources for Nepal students. Covering Class 9, SEE preparation, Class 11, Class 12, SLC, programming, DBMS, networking, HTML, JavaScript, PHP, OOP and more.

Featured Post

Grade 10 Computer Science: Specification Grid & Model Questions

Specification Grid & Model Questions of Computer Science | Grade 10 📚 Examination Resource Specification Grid & M...

Followers