JNTU
JNTU B.Tech I COMPUTER PROGRAMMING Previous Question Paper (June - 2022 - R13)
Answer any five questions
All questions carry equal marks
Main
List out various steps involved in creating and running a program.
Answer
The process of creating and executing a C program involves several sequential stages:
- Writing the Source Code: Using a text editor, the programmer writes the code in C language and saves it with a .c extension.
- Preprocessing: The preprocessor handles directives like #include and #define, replacing them with actual code or header file contents.
- Compilation: The compiler translates the preprocessed source code into assembly language or machine-level object code (.obj or .o file).
- Linking: The linker combines the object code with necessary library functions (like printf or scanf) to create an executable file (.exe).
- Loading and Execution: The loader brings the executable file into the computer's memory (RAM), and the CPU executes the instructions.
Elaborate different types of tokens in C in detail with examples.
Answer
Tokens are the smallest individual units of a C program. They are categorized into the following types:
- Keywords: Predefined, reserved words with special meanings. Examples:
int, float, if, else, while - Identifiers: Names given to variables, functions, or arrays. Examples:
sum, total_marks, calculateArea - Constants: Fixed values that do not change during execution. Examples:
10, 3.14, 'A', "Hello" - Strings: A sequence of characters enclosed in double quotes. Example:
"Welcome to C" - Operators: Symbols used to perform arithmetic, logical, or relational operations. Examples:
+, -, *, ==, && - Special Symbols: Characters used for specific structural purposes. Examples:
{ }, [ ], ( ), ;, ,
Discuss about nested if statements with an example.
Answer
Sign in to view the complete answer paper.
Explain for, while and do-while loops in detail.
Answer
Sign in to view the complete answer paper.
What is a function? What is meant by call-by value and call-by reference?
Answer
Sign in to view the complete answer paper.
List out the different types of storage classes with valid example.
Answer
Sign in to view the complete answer paper.
Discuss about preprocessor directives in C and explain with example.
Answer
Sign in to view the complete answer paper.
Write a C program to multiply two matrices of different order.
Answer
Sign in to view the complete answer paper.
With proper examples explain different arithmetic operations on pointers.
Answer
Sign in to view the complete answer paper.
Write a C program to read a set of strings and sort them in alphabetical order.
Answer
Sign in to view the complete answer paper.
Explain declaration and initialization of array of strings.
Answer
Sign in to view the complete answer paper.
Write a C program to find whether a given string is palindrome or not.
Answer
Sign in to view the complete answer paper.
Explain the following: i) Nested structures ii) Array of structures.
Answer
Sign in to view the complete answer paper.
Write a C program to display the contents of the file in reverse order.
Answer
Sign in to view the complete answer paper.
Explain binary search method. Illustrate binary search on {2, 11, 15, 17, 19, 21, 25} and search for elements 24 and 17.
Answer
Sign in to view the complete answer paper.
Define Sorting. Explain bubble sort method with a program and example.
Answer
Sign in to view the complete answer paper.