JNTU
JNTU B.Tech I Year COMPUTER PROGRAMMING IN C Previous Question Paper (October/November - 2020 - R16)
Answer any five questions. All questions carry equal marks.
Main
Explain in detail about C-Tokens.
Answer
C-tokens are the smallest individual units of a C program that are meaningful to the compiler. The entire source code is parsed into these tokens during the compilation process. They are categorized into the following types:
- Keywords: Reserved words with fixed meanings, such as int, float, if, and while, which cannot be used as identifiers.
- Identifiers: Names given to variables, functions, arrays, or structures. They must start with a letter or underscore and contain only letters, digits, or underscores.
- Constants: Fixed values that do not change during program execution, including integer constants (e.g., 10), floating-point constants (e.g., 3.14), character constants (e.g., 'A'), and string literals (e.g., "Hello").
- Strings: A sequence of characters enclosed in double quotes, automatically terminated by a null character (\0).
- Operators: Symbols that perform arithmetic, logical, relational, or bitwise operations, such as +, -, *, /, ==, and &&.
- Special Symbols: Characters with specific syntactic roles, such as brackets [], parentheses (), braces {}, commas ,, and semicolons ;.
Explain about operator precedence and associativity.
Answer
Operator precedence and associativity define the order in which expressions are evaluated when multiple operators are present.
Operator Precedence: This determines the priority of operators. When an expression contains different types of operators, the one with higher precedence is evaluated first. For example, in the expression 5 + 3 * 2, the multiplication operator (*) has higher precedence than addition (+), so it is performed first, resulting in 11 rather than 16.
Operator Associativity: This determines the direction of evaluation when operators in an expression have the same precedence. Associativity can be either left-to-right or right-to-left.
- Left-to-Right: Most binary operators, such as +, -, *, and /, follow this rule. For instance, 10 - 5 - 2 is evaluated as (10 - 5) - 2 = 3.
- Right-to-Left: Unary operators (like !, ++, --) and assignment operators (=, +=) follow this rule. For example, in the expression a = b = 5, the assignment is performed from right to left, assigning 5 to b, and then b to a.
Understanding these rules is essential for writing predictable code and avoiding logical errors in complex expressions.
Explain 2-dimensional arrays with an example.
Answer
Sign in to view the complete answer paper.
List and explain storage classes in detail.
Answer
Sign in to view the complete answer paper.
Discuss about String Input / Output Functions with example programs.
Answer
Sign in to view the complete answer paper.
Explain in detail about Memory Allocation Functions with examples.
Answer
Sign in to view the complete answer paper.
Explain in detail about Nested Structures with an example program.
Answer
Sign in to view the complete answer paper.
Discuss about typedef and enumeration with an example.
Answer
Sign in to view the complete answer paper.
Write about File Positioning functions.
Answer
Sign in to view the complete answer paper.
Write a C program to copy the contents of one file to another file.
Answer
Sign in to view the complete answer paper.
Explain in detail about Iterative Control Statements in detail.
Answer
Sign in to view the complete answer paper.
Discuss about Hexadecimal number system with an example.
Answer
Sign in to view the complete answer paper.
Write a program to implement binary search.
Answer
Sign in to view the complete answer paper.
Explain about inter function communication in detail.
Answer
Sign in to view the complete answer paper.
Define Pointer and Write a program to implement pointer to function.
Answer
Sign in to view the complete answer paper.
Explain string manipulation functions.
Answer
Sign in to view the complete answer paper.