User:Saroj Neupane Lesson Plan 8: Difference between revisions

From ICTED-WIKI
Jump to navigation Jump to search
mNo edit summary
 
Line 79: Line 79:
* What is array? How to declare and initialize array in c?
* What is array? How to declare and initialize array in c?
* Write simple program of array in c ?
* Write simple program of array in c ?
[[Category:Lesson Plan]]
[[Category: Lesson Plan]]
__notoc__
__notoc__
[[Category: BICTE]]

Latest revision as of 04:29, 12 March 2024

Subject : Computer Science

Period: 3rd

Topic: Array in C Programming

School: ABC School

Class: 10

Unit: Seven

Time: 15 min

No. of Students: 20

Specific Objectives[edit | edit source]

By the end of this brief lesson, students should be able to:

  • Understand the concept of arrays in C programming.
  • Declare, initialize, and access elements in an array.

Teaching Materials[edit | edit source]

  • Whiteboard and markers
  • Quick access to a C compiler for live coding demonstration

Teaching Learning Activity[edit | edit source]

Introduction (3 minutes):

  • Briefly review the concept of variables.
  • Introduce the need for handling multiple values efficiently.
  • Explain that arrays are collections of similar elements stored in contiguous memory locations.
  • The array is the simplest data structure where each data element can be randomly accessed by using its index number.

Declaration and Initialization (5 minutes):

  • Show the syntax for declaring an array and initializing it.
  • Syntax: data_type array_name[array_size]; //Declaration of array Example: int marks[5];
  • marks[0]=80;//initialization of array
  • marks[1]=60;
  • marks[2]=70;
  • marks[3]=85;
  • marks[4]=75;
  • Declaration with Initialization:
  • int numbers[5] = {1, 2, 3, 4, 5};

Accessing Array Elements (3 minutes):

  • Explain how to access individual elements using index notation.
  • int x = numbers[2]; // Access the third element (index 2) of the array

Code Demonstration (4 minutes):

Quickly demonstrate a simple code example on the whiteboard.

  1. include <stdio.h>
  1. int main() {
  2. int numbers[5] = {1, 2, 3, 4, 5};
  3. for (int i = 0; i < 5; i++) {
  4. printf("Element %d: %d\n", i, numbers[i]);
  5. }
  6. return 0;
  7. }

Conclusion (2 minutes):

  • Summarize the key points: Arrays store multiple values of the same type.
  • Encourage students to practice declaring, initializing, and accessing arrays.

Evaluation[edit | edit source]

  • What is array? How to declare and initialize array in c?
  • Write simple program of array in c ?