JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD
JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD MCA I COMPUTER PROGRAMMING Previous Question Paper (July/August - 2021 - R13)
Answer any five questions. All questions carry equal marks.
Main
What is a data type? List various data types in C and write about their sizes in bytes.
Answer
A data type is a classification that specifies the type of value a variable can hold and the operations that can be performed on that data. It determines how much memory is allocated for the variable and how the bits are interpreted.
The common data types in C and their typical sizes on a 32-bit system are:
- char: 1 byte, used for single characters.
- int: 2 or 4 bytes, used for integer values.
- float: 4 bytes, used for single-precision floating-point numbers.
- double: 8 bytes, used for double-precision floating-point numbers.
- void: 0 bytes, represents the absence of a value.
Modifiers like short, long, signed, and unsigned can be applied to these types to alter their range and storage requirements.
Enumerate all the operators in C with appropriate examples.
Answer
C operators are symbols used to perform operations on variables and values:
- Arithmetic Operators (+, -, *, /, %): Used for math, e.g., a + b.
- Relational Operators (==, !=, >, <, >=, <=): Used for comparisons, e.g., a > b.
- Logical Operators (&&, ||, !): Used for boolean logic, e.g., (a && b).
- Bitwise Operators (&, |, ^, ~, <<, >>): Operate on bits, e.g., a & b.
- Assignment Operators (=, +=, -=, etc.): Assign values, e.g., a += 5.
- Increment/Decrement Operators (++ , --): Change values by one, e.g., a++.
- Conditional (Ternary) Operator (?:): A shorthand for if-else, e.g., condition ? x : y.
- Special Operators (sizeof, &, *, ->): Used for memory and pointer operations, e.g., sizeof(int).
Evaluate the following expression in C with the values A=5, B=20, C=15, D=10:
Answer
Sign in to view the complete answer paper.
Write a C program to find biggest of given three numbers.
Answer
Sign in to view the complete answer paper.
Demonstrate all the decision making statements in C with examples.
Answer
Sign in to view the complete answer paper.
Write a C program to find the sum of 20 natural numbers.
Answer
Sign in to view the complete answer paper.
Differentiate between call by value and call by reference in C.
Answer
Sign in to view the complete answer paper.
Write a C program to generate Fibonacci series using recursive functions.
Answer
Sign in to view the complete answer paper.
How to define and declare multi-dimensional arrays? Give an example.
Answer
Sign in to view the complete answer paper.
Write a C program for multiplication of two matrices.
Answer
Sign in to view the complete answer paper.
Define a pointer. What are the advantages of pointers than arrays?
Answer
Sign in to view the complete answer paper.
Discuss about malloc( ) and calloc( ) memory allocation functions with suitable examples.
Answer
Sign in to view the complete answer paper.
Demonstrate self-referential structures in C with suitable examples.
Answer
Sign in to view the complete answer paper.
Explain about enumerated data types in detail.
Answer
Sign in to view the complete answer paper.
Write syntax and examples for fopen( ), fclose( ) and fflush( ) functions.
Answer
Sign in to view the complete answer paper.
Write syntax and examples for positioning functions in C.
Answer
Sign in to view the complete answer paper.