Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
18 views3 pages

Computer Science Paper II Solved-1

The document is a solved Computer Science Paper-II for 2nd Year students, containing short answer questions and detailed answers. It covers topics such as IDEs, escape sequences, expressions in C, arrays, pointers, control structures, data types, operators, and I/O functions. The document provides definitions, examples, and explanations relevant to each topic.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views3 pages

Computer Science Paper II Solved-1

The document is a solved Computer Science Paper-II for 2nd Year students, containing short answer questions and detailed answers. It covers topics such as IDEs, escape sequences, expressions in C, arrays, pointers, control structures, data types, operators, and I/O functions. The document provides definitions, examples, and explanations relevant to each topic.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Computer Science Paper-II (2nd Year) –

Solved
SECTION B (Short Answer Questions)
Attempt any 10 questions.

1. 1. What is IDE?

An IDE (Integrated Development Environment) is software combining developer tools in


one GUI. Example: Turbo C, Dev-C++. Shortcut to run: Ctrl + F9.

2. 2. What are escape sequences?

Special characters like \n (newline), \t (tab), used for formatting output.

3. 3. Expressions in C

a) (a + b)/(ab): (a + b) / (a * b);
b) Y = (a + b)²: Y = (a + b) * (a + b);

4. 4. Valid/Invalid Identifiers

Valid: num1, _value, totalSum. Invalid: 1stValue, float, a+b

5. 5. Increment/Decrement Operators

++ (increment), -- (decrement). Example: x++; x--;

6. 6. Output of Code

int x=1; printf("%d %d %d", x, ++x, x++); → Undefined output (compiler dependent).

7. 7. What is an Array?

A collection of similar data types. Example: int arr[5];

8. 8. Output of int num[5] = {3,5,7,10,6}; printf("%d", num[2]);

Output: 7

9. 9. Break/Continue

break exits loop; continue skips to next iteration.

10. 10. While vs Do-While


while checks condition first, do-while executes once before checking.

11. 11. Pointer

Stores address of another variable. Example: int *p = &x;

12. 12. Compiler in C

Converts source code to machine code.

13. 13. High-Level Language

Closer to human language. Example: C, Python.

14. 14. Source vs Object Code

Source: programmer-written code. Object: machine-generated code.

15. 15. Address Operator

& gives address. Example: &x;

16. 16. Syntax of C Program

#include <stdio.h>
int main() { printf("Hello"); return 0; }

SECTION C (Detailed Answer Questions)


Attempt any 3 questions.

17. 1. Control Structures in C

Sequential, Conditional (if, switch), Iterative (for, while, do-while).


Example:
for (int i = 0; i < 5; i++) { printf("%d", i); }

18. 2. Data Types

int, float, char, double, void.

19. 3. Operators

Arithmetic (+, -, *, /), Relational (==, !=), Logical (&&, ||).

20. 4. I/O Functions

printf() for output, scanf() for input.


Example: scanf("%d", &x);
21. 5. Functions

Reusable blocks. Types: with/without arguments/return. Example:


int sum(int a, int b) { return a + b; }

You might also like