Class 10th Computer Science Notes 2026 | C Programming - Short Questions & Anserws

 


"Welcome, Students! To help you excel in your Class 10th Computer Science Board Exams, we have compiled a comprehensive list of the most important short questions from the 'Introduction to Programming' chapter. These questions are specifically selected based on the Punjab Board curriculum and past paper trends.

We understand that technical language can sometimes be difficult, so we have simplified every answer into easy-to-understand English. This ensures that you can learn the concepts quickly and retain them longer without the need for rote memorization. Whether you are a beginner or looking for a quick revision, these notes are your ultimate guide to scoring full marks in the programming section. Start your preparation now and boost your confidence for the final exams!"

C Programming - Short Questions (Easy Version)


Section 1: Basics of Programming

Q1: Define computer program and software.

Ans: A set of instructions given to a computer to solve a problem is called a computer program or software.

Q2: What is Computer Programming and who is a Programmer?

Ans: The process of writing programs is called Programming. The person who knows how to write these programs correctly is a Programmer.

Q3: When and who developed C language?

Ans: C language was developed by Dennis Ritchie at Bell Laboratories between 1969 and 1973.

Q4: What is Programming Language?

Ans: It is a special language used by programmers to write computer programs.

  • Examples: C, C++, Java, Python.

Q5: What is a Programming Environment?

Ans: A collection of all necessary tools needed to write and run a program is called a Programming Environment.

Q6: What is an Integrated Development Environment (IDE)?

Ans: An IDE is a software that provides a complete environment (editor, compiler, etc.) to write and test programs in one place.

  • Examples: Code::Blocks, Dev C++, Visual Studio.

Q7: What is a Text Editor?

Ans: A text editor is a simple software used to type and edit the program code.

Q8: What is a Compiler?

Ans: A compiler is a software that converts "High-Level Language" code into "Machine Language" (0s and 1s) so the computer can understand it.

Q9: What is Syntax and Syntax Error?

Ans: * Syntax: The grammatical rules of a programming language.

  • Syntax Error: An error that occurs when we do not follow the rules (syntax) of the language.


Section 2: Structure of C Program

Q10: What are Reserved Words (Keywords)?

Ans: These are words that have a predefined meaning for the compiler. We cannot use them as our own variable names.

  • Examples: int, float, if, else, return.

Q11: What are the main parts of a C program?

Ans: There are three main parts:

  1. Link Section (Header files)

  2. Main Section (main function)

  3. Body of Main (Code inside { })

Q12: What is the Link Section (Header Section)?

Ans: It is used to include "Header Files" in our program using the #include statement. These files contain built-in functions.

  • Example: #include <stdio.h>

Q13: What is the Main Section and Body of Main?

Ans:

  • Main Section: Consists of main() function. It is the starting point of program execution.

  • Body: The actual code written inside curly braces { }.

Q14: Write three key points to write a C program correctly.

Ans: 1. Follow the correct sequence of statements.

2. C is case-sensitive (small letters and capital letters are different).

3. Every statement must end with a semi-colon (;).


Section 3: Comments, Constants & Variables

Q15: What are Comments and their types?

Ans: Comments are notes for the programmer that the compiler ignores.

  • Single-line: Starts with //

  • Multi-line: Starts with /* and ends with */

Q16: What are Constants and their types?

Ans: Constants are values that cannot change during program execution.

  • Types: Integer Constants (5), Real Constants (3.14), Character Constants ('A').

Q17: What is a Variable?

Ans: A variable is a name given to a memory location to store data. Its value can change during the program.

Q18: What are the rules for naming variables?

Ans:

  1. Can contain letters, digits, and underscores (_).

  2. Must begin with a letter or underscore (cannot start with a digit).

Q19: Define Data Types (int, float, char).

Ans:

  • int: Stores whole numbers (4 bytes).

  • float: Stores decimal numbers (4 bytes).

  • char: Stores a single character (1 byte).

Q20: Difference between Signed and Unsigned Int.

Ans:

  • Signed int: Can store both positive and negative numbers.

  • Unsigned int: Can store only positive numbers.

Q21: Difference between Variable Declaration and Initialization.

Ans:

  • Declaration: Telling the compiler the name and type of variable. (e.g., int age;)

  • Initialization: Giving the first value to a variable. (e.g., age = 20;)



Section 4: Variables and Memory

Q22: Difference between Variables and Constants.

Ans: * Variable: A named memory location whose value can change during the program.

  • Constant: A value that cannot be changed during the program.

Feature

Variable

Constant

Value

Changes

Fixed

Example

int marks = 50;

5, 75.7, 'A'

Q23: What is Variable Declaration?

Ans: It means telling the compiler the name and data type of the variable before using it.

  • Syntax: data_type variable_name;

  • Example: int age; or float price;

Q24: What is Variable Initialization?

Ans: Assigning a value to a variable for the very first time is called initialization.

  • Syntax: data_type variable_name = value;

  • Example: int age = 18;

Q25: Differentiate between Real and Character Constants.

Ans:

  • Real Constant: These are numbers with decimal points. (e.g., 3.14, -15.5)

  • Character Constant: Any single letter, digit, or symbol enclosed in single quotes. (e.g., 'a', '7', '+')

Q26: What is 'char' Data Type?

Ans: The char keyword is used to store a single character. It takes only 1 byte of memory.

  • Example: char grade = 'A';

Q27: What is Floating Point Data?

Ans: It is used to store real numbers (numbers with fractions or decimals). It uses the keyword float and takes 4 bytes of memory.

  • Example: float weight = 65.5;


Section 5: Data Types and Variables (Remaining)

Q28: How many Data Types of a Variable are there in C?

Ans: There are mainly three basic data types in C:

  1. Integer (int) – For whole numbers.

  2. Floating Point (float) – For decimal numbers.

  3. Character (char) – For single letters or symbols.

Q29: Define Integer (int).

Ans: The int data type is used to store whole numbers (without decimals). It takes 4 bytes of memory.

  • Example: int marks = 95;

Q30: What is the difference between Signed Int and Unsigned Int?

Ans: * Signed int: Can store both positive and negative numbers (e.g., -5, 10).

  • Unsigned int: Can store only positive numbers (e.g., 0 to 4,294,967,295).

Q31: What is Floating Point Data (float)?

Ans: The float data type is used to store real numbers (numbers with a decimal point). It takes 4 bytes of memory.

  • Example: float price = 99.99;

Q32: What is the purpose of Character (char) data type?

Ans: The char keyword is used to store a single character. It is written inside single quotes and takes 1 byte of memory.

  • Example: char grade = 'B';

Q33: Write down any two rules for naming variables.

Ans: 1. A variable name can only contain letters, digits, and underscores (_).

2. It must start with a letter or underscore, not a digit.

Q34: What is the difference between Variables and Constants?

Ans: * Variable: A name for a memory location whose value can change during the program.

  • Constant: A fixed value that cannot be changed (e.g., 10, 3.14, 'X').

Q35: What is Variable Declaration?

Ans: Telling the compiler the name and type of a variable before using it.

  • Structure: data_type variable_name;

  • Example: int age;

Q36: What is Variable Initialization?

Ans: Assigning a value to a variable for the first time is called initialization.

  • Structure: data_type variable_name = value;

  • Example: int age = 20;



Important Notes for Students (Exam Tips):

  1. Case Sensitivity: Hamesha yaad rakhein ke C language mein int aur Int mukhtalif hain. Hamesha small letters use karein.

  2. Semicolon (;): Har statement ke baad ; lagana lazmi hai, warna "Syntax Error" aaye ga.

  3. Naming Rules: Variable ka naam hamesha letter (a-z) ya underscore (_) se shuru karein, ginti (1, 2, 3) se nahi.


0 Comments