JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD
JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD MCA I COMPUTER PROGRAMMING USING C Previous Question Paper (July/August - 2021 - R17)
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 defines the type of data a variable can hold, the range of values it can represent, and the set of operations that can be performed on it. In C, data types are categorized as primary, derived, and user-defined.
| Data Type | Size (Bytes) |
|---|---|
| char | 1 |
| int | 2 or 4 |
| float | 4 |
| double | 8 |
| short int | 2 |
| long int | 4 or 8 |
| long double | 10, 12, or 16 |
Enumerate all the operators in C with appropriate examples.
Answer
Operators in C are symbols that perform specific mathematical or logical manipulations. The primary categories are:
- Arithmetic Operators (+, -, *, /, %): Used for calculations. Example: a + b.
- Relational Operators (==, !=, >, <, >=, <=): Used to compare two values. Example: a > b.
- Logical Operators (&&, ||, !): Used to combine conditions. Example: (a > b && c > d).
- Assignment Operators (=, +=, -=, *=, /=): Used to assign values to variables. Example: a += 5.
- Bitwise Operators (&, |, ^, ~, <<, >>): Perform operations at the bit level. Example: a & b.
- Increment/Decrement Operators (++ , --): Increase or decrease a value by one. Example: ++a.
- Conditional (Ternary) Operator (?:): A shorthand for if-else. Example: (a > b) ? a : b.
- Special Operators (sizeof, &, *, ->): Used for memory management and pointer operations. Example: 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.