JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD
JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD MCA C AND DATA STRUCTURES Previous Question Paper (October/November - 2022 - R20)
Answer any five questions
All questions carry equal marks
Main
Explain the steps involved in Creating and Running the programs?
Answer
The process of creating and running a C program involves several sequential stages:
- Writing the Source Code: Use a text editor to write the program code and save it with a .c extension.
- Preprocessing: The preprocessor handles directives (e.g., #include, #define), performing text substitution and file inclusion to produce an expanded source file.
- Compilation: The compiler translates the preprocessed source code into assembly language specific to the target processor architecture.
- Assembly: The assembler converts the assembly code into machine-readable object code (a .obj or .o file).
- Linking: The linker combines the object file with necessary library functions (like printf or scanf) to create a single executable file (a .exe file).
- Execution: The operating system loads the executable file into memory and executes the instructions to produce the desired output.
Discuss different bit wise operators in ‘C’ using suitable examples.
Answer
Bitwise operators perform operations on individual bits of integer operands. The primary operators are:
- Bitwise AND (&): Returns 1 if both bits are 1. Example: 5 & 3 (0101 & 0011) results in 0001 (1).
- Bitwise OR (|): Returns 1 if at least one bit is 1. Example: 5 | 3 (0101 | 0011) results in 0111 (7).
- Bitwise XOR (^): Returns 1 if bits are different. Example: 5 ^ 3 (0101 ^ 0011) results in 0110 (6).
- Bitwise NOT (~): Inverts all bits. Example: ~5 (binary 0101) becomes 1010 (in two's complement, this represents -6).
- Left Shift (<<): Shifts bits to the left by a specified number of positions, filling with zeros. Example: 5 << 1 (0101 becomes 1010) results in 10.
- Right Shift (>>): Shifts bits to the right by a specified number of positions. Example: 5 >> 1 (0101 becomes 0010) results in 2.
Draw flowchart for printing the sum of n numbers.
Answer
Sign in to view the complete answer paper.
List out type conversions in ‘C’ using suitable examples.
Answer
Sign in to view the complete answer paper.
Explain the switch statement with syntax and example.
Answer
Sign in to view the complete answer paper.
Differentiate between while and do while statements with example.
Answer
Sign in to view the complete answer paper.
What is a null statement? Explain its usefulness with suitable example.
Answer
Sign in to view the complete answer paper.
Write a program using for loop to reverse the digits of the number.
Answer
Sign in to view the complete answer paper.
Write a C program to perform the addition of two matrices.
Answer
Sign in to view the complete answer paper.
Explain the difference between ‘call by value’ and ‘call by reference’ using pointers.
Answer
Sign in to view the complete answer paper.
Why Multidimensional array is used? Explain it with suitable example.
Answer
Sign in to view the complete answer paper.
List out the memory allocation functions and explain their importance.
Answer
Sign in to view the complete answer paper.
Define Structure. Explain how the structure can be accessed using suitable examples.
Answer
Sign in to view the complete answer paper.
Explain how End of File is detected using a small example.
Answer
Sign in to view the complete answer paper.
What is insertion sort? Sort the following elements using insertion sort method: 24 56 47 35 10 90 82 31.
Answer
Sign in to view the complete answer paper.
Define a stack. Describe ways to implement stack.
Answer
Sign in to view the complete answer paper.