Friday, October 3, 2025

Unit 1 (Programming in C with Data Structures) – Short Notes (6 Marks Type)

 Q1. Define Algorithm and its properties.

Answer:
An algorithm is a step-by-step finite process to solve a specific problem.

Properties:

  1. Definiteness → Steps must be clear.

  2. Finiteness → Algorithm must end after finite steps.

  3. Input → Zero or more inputs accepted.

  4. Output → At least one output produced.

  5. Effectiveness → Steps must be simple and feasible.


Q2. What is a Flowchart? List its advantages.

Answer:
A flowchart is a graphical representation of an algorithm using symbols like oval (Start/End), rectangle (Process), diamond (Decision), parallelogram (I/O).

Advantages:

  • Easy to understand.

  • Helps in debugging before coding.

  • Improves communication between developers.


Q3. Explain the structure of a C program.

Answer:
Basic structure:

  1. Preprocessor directives (#include <stdio.h>)

  2. Main function (int main() { ... })

  3. Declarations (variables)

  4. Statements (logic/code)

  5. Return statement (return 0;)


Q4. Explain Compilation & Execution of a C program.

Answer:
Steps:

  1. Writing → Save program as .c file.

  2. CompilationCompiler converts C code → machine code.

  3. LinkingConnects with libraries.

  4. Execution → Run the program → output is shown.


Q5. What are Data Types in C?

Answer:
Data types define the kind of data stored in variables.


Q6. What are Identifiers and Keywords in C?

Answer:

  • Identifiers: Names given to variables, functions, etc. (e.g., marks, sum).

  • Keywords: Reserved words with special meaning, cannot be used as identifiers (e.g., int, while, return).

No comments:

Post a Comment

✅ UNIT 4 — POSET, LATTICES & BOOLEAN ALGEBRA (DISCRETE MATHEMATICS)

  ✅ UNIT 4 — POSET, LATTICES & BOOLEAN ALGEBRA 1. Poset Partially Ordered Set A pair (A, ≤) where relation is: Reflexive Anti-...