Code: ppsAeronautical Engineering2nd Semester9 Examination Papers

Programming for Problem Solving

Official Bihar Engineering University examination question papers, marks distribution, and questions transcript. Available exam sessions: 2026, 2025, 2024, 2022, 2019, 2018.

Exam Year:

Get Instant AI Answers on this Paper

Open BEU Connect Android app to solve any numerical or derive formulas step by step.

Ask AI in App
Official Exam Paper TranscriptB.Tech 2nd Semester Examination, 2026
Bihar Engineering University, Patna
B.Tech 2nd Semester Examination - 2026

Programming for Problem Solving

Time: 03 HoursCode: 100203Full Marks: 70

Instructions:

  1. The marks are indicated in the right-hand margin.
  2. There are NINE questions in this paper.
  3. Attempt FIVE questions in all.
  4. Question No. 1 is compulsory.
Q.1 Choose the correct option / answer the following (Any seven question only):[2×7=14]
  1. What is the output of the following C-code?

    main()
    {
        int j = 4;
        (!j != 1 ? printf("\nWelcome") : printf("\nGood Bye"));
    }
    1. Welcome
    2. Good Bye
    3. Welcome Good Bye
    4. Compilation Error
  2. The purpose of "r+" mode is to

    1. Open file only for reading
    2. Open file only for writing
    3. Open file for both reading and writing
    4. None of these
  3. Which of the following is a bitwise operator?

    1. <
    2. <=
    3. <<
    4. &&
  4. Members of a union use

    1. Different storage locations
    2. No storage locations
    3. Same storage locations
    4. None of these
  5. Consider the following function implemented in C:

    void printxy(int x, int y)
    {
        int *ptr;
        x = 0;
        ptr = &x;
        y = *ptr;
        *ptr = 1;
        printf("%d,%d", x, y);
    }
    1. 0, 0
    2. 0, 1
    3. 1, 0
    4. 1, 1
  6. The size of a pointer to a float array of size 10 is

    1. 40 bytes
    2. 4 bytes
    3. 20 bytes
    4. Can't be determined
  7. A function may contain

    1. One return statement
    2. More than two return statements
    3. Two return statements
    4. None of these
  8. What would be the output of the following program?

    int main()
    {
        float a = 3.15529;
        printf("\n%6.2f", a);
    }
    1. 16
    2. 15
    3. 15529
    4. Compilation error
  9. Determine the output for the given program:

    #include<stdio.h>
    #define mul(x) x*8
    int main()
    {
        int y = mul(10/3);
        printf("%d", y);
    }
    1. 0
    2. 24
    3. 24.33
    4. 26.64
  10. In C, if you pass an array as an argument to a function, what actually gets passed?

    1. Value of elements in array
    2. Base address of the array
    3. First element of the array
    4. Address of the last element of array
Q.2
  1. Explain the role of operating system and compiler. Differentiate between syntax errors and logical errors in programming with appropriate examples.

    [7]
  2. Define Algorithm along with its characteristics. Draw the flowchart to illustrate the concept of break and continue statements taking suitable examples.

    [7]
Q.3
  1. What is tail recursion? Write a recursive function to display the first n terms of the Fibonacci series. Also write the main program.

    [7]
  2. Write a C program to find the greatest of the three numbers entered through the keyboard using (i) nested if-else and (ii) conditional operators.

    [7]
Q.4
  1. Write a C program to generate the following pattern:

    GFEDCBA
     FEDCBA
      EDCBA
       DCBA
        CBA
         BA
          A
    [7]
  2. Compare the working of while and do-while loops using flow diagram and examples.

    [7]
Q.5
  1. Compare switch and else-if ladder. Write a program in C which prints all the digits of a positive integer number entered by user into words. E.g., if 732 is entered through the keyboard, the program should output "seven three two".

    [7]
  2. Discuss about some built-in string functions. Write a C program to test whether a given string is a palindrome string.

    [7]
Q.6
  1. Discuss the difference between Call by value and Call by reference with suitable examples.

    [7]
  2. Explain the memory representation of one- and two-dimensional arrays in C programming with neat diagrams. Write a C program to multiply matrices A1 (m×n) and A2 (n×q) and store the results in matrix R (m×q).

    [7]
Q.7
  1. Differentiate between structure and union. For what kind of applications are unions useful? Explain with an example.

    [7]
  2. Arrange the following given numbers in ascending order using selection sort technique: 17, 7, 4, 9, 11, 3, 15. Clearly explain every pass. Write a C function to implement selection sort and analyse its performance in terms of time complexity.

    [7]
Q.8
  1. Write a C program using structures to read the following information of 50 employees: employee name, employee id-number, experience (in years) and salary. The program should print the number and names of all the employees who have 5 years or more experience but salary less than Rs. 10,000.

    [7]
  2. Write a program in C to count the number of lines, words, and characters in a given text file.

    [7]
Q.9 Write short note on any two of the following:[7×2=14]
  1. Operator Precedence and Associativity

  2. Bitwise Operators

  3. Pointer to an Array

  4. Binary Search

Related Official Syllabus

Programming for Problem Solving

100203

Official BEU curriculum units & topics for this examination subject.

Unit 1.0: Introduction to Programming

Introduction to components of a computer system (disks, memory, processor, where a program is stored and executed, operating system, compilers etc.) • Idea of Algorithm: steps to solve logical and numerical problems • Representation of Algorithm: Flowchart/ Pseudo code with examples • From algorithms to programs; source code • Variables (with data types) variables and memory locations • Syntax and Logical Errors in compilation • Object and executable code

Unit 2.0: Operators, Conditional Branching and Loops

Arithmetic expressions/arithmetic operators • Relational operators • Logical operators • Bitwise operators and precedence • Writing and evaluation of conditionals and consequent branching • Iteration and loops

Unit 3.0: Arrays and String

Array declaration & initialization • Bound checking arrays (1-d, 2-d) • Character arrays and strings

Unit 4.0: Function, Recursion and Pointers

Functions (including using built in libraries) • Parameter passing in functions • Call by value • Passing arrays to functions: Recursion, as a different way of solving problems • Example programs, such as Finding Factorial, Fibonacci series, Ackerman function etc. • Idea of pointers • Defining pointers • Use of Pointers in self- referential structures • Idea of call by reference

Unit 5.0: User defined Data Types and File handling

Structure: defining, declaring, initializing; accessing structure members, processing of structure, array of structures, structures within structure, structure and function, type definition • Union: definition, declaration, accessing union members, initializing union • Introduction, file declaration, opening and closing a file, working with text and binary files, I/O operations on file, error handling, random access to files

View Complete 2nd Semester Syllabus

Prepare Better with BEU Connect

  • Download papers for 100% offline study
  • Ask AI for step-by-step problem breakdown
  • Attempt official GATE CBT mock tests
  • Calculate SGPA and track attendance
Download Android App