JNTU
JNTU MCA 1 COMPUTER PROGRAMMING USING C Previous Question Paper (October/November - 2022 - R17)
Answer any five questions. All questions carry equal marks.
Main
Describe the different types of operators that are included in C?
Answer
Operators in C are symbols that perform specific mathematical or logical manipulations on operands. They are categorized as follows:
- Arithmetic Operators: Used for mathematical calculations (+, -, *, /, %).
- Relational Operators: Used to compare two values (==, !=, >, <, >=, <=).
- Logical Operators: Used to combine conditional statements (&&, ||, !).
- Bitwise Operators: Perform operations at the bit level (&, |, ^, ~, <<, >>).
- Assignment Operators: Used to assign values to variables (=, +=, -=, *=, /=, %=).
- Increment/Decrement Operators: Modify the value of a variable by one (++ and --).
- Conditional (Ternary) Operator: A shorthand for if-else statements (?:).
- Special Operators: Includes comma operator (,), sizeof operator, and pointer operators (&, *).
How to write, compile, linking and running a C program?
Answer
The process of executing a C program involves the following stages:
- Writing: The source code is written using a text editor and saved with a .c extension.
- Preprocessing: The preprocessor handles directives like #include and #define, producing an expanded source file.
- Compiling: The compiler translates the 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 to create an executable file (.exe or a.out).
- Running: The executable file is loaded into memory by the operating system and executed, producing the desired output.
Elaborate on the implicit and explicit type conversions?
Answer
Sign in to view the complete answer paper.
Write C program to find the areas and perimeters of circle, square, rectangle and triangle?
Answer
Sign in to view the complete answer paper.
Write a program that replies either Leap Year or Not a Leap Year, given a year. It is a leap year if the year is divisible by 4 but not by 100. A year that is divisible by both 4 and 100 is a leap year if it is also divisible by 400.
Answer
Sign in to view the complete answer paper.
Mention the limitations of recursion? Write a recursive method to compute the sum of the first N positive odd integers.
Answer
Sign in to view the complete answer paper.
Write for, do–while, and while statements to compute the following:
i) 1+3+7+ … + (220-1)
ii) 1×2×4×….× 220
Answer
Sign in to view the complete answer paper.
How does macro simulate functions with/without parameters? Elaborate on nested macros, undefining macros and predefined macros?
Answer
Sign in to view the complete answer paper.
Write program to perform array sorting and Merge two sorted arrays into another array in a sorted order?
Answer
Sign in to view the complete answer paper.
Write program to compute matrix transpose and multiplication?
Answer
Sign in to view the complete answer paper.
Use arrays to represent the three vertices of a triangle, calculate the length of the three sides of a triangle formed with these vertices. Then determine whether an equilateral triangle can be formed with the given vertices.
Answer
Sign in to view the complete answer paper.
How to pass arrays to functions with/without pointers?
Answer
Sign in to view the complete answer paper.
Write a menu-based C program to perform the following operations:
a) reading a complex number b) writing a complex number
c) addition of two complex numbers d) subtraction of two complex numbers
e) multiplication of two complex numbers
Represent the complex number using a structure.
Answer
Sign in to view the complete answer paper.
Write a program that opens an existing text file and copies it to a new text file with all lowercase letters changed to capital letters and all other characters unchanged.
Answer
Sign in to view the complete answer paper.
Describe different file opening modes used with the fopen() function. Compare fscanf() and fread() functions?
Answer
Sign in to view the complete answer paper.