Entrance Announcement
MICTE 2080
2080 Magh 07
User:Shridhar Paudel/Lesson Plan 4
Subject: Programming in C | Date: 2080/10/26 |
Class: BICTE | Period: 2nd |
Semester: 1st | Time: 10 minutes |
Topic: Looping in C using while |
Specific Objectives:
At the end of this topic the students will be able to:
a) Understand the syntax of while loop
b) Use of while loop statement in suitable situation
Teaching Materials:
Whiteboard, Marker, Computer
Teaching Learning Activities:
a) At first, I will revise the topic which was taught last day within one minute.
b) Then I will give the concept of while loop statement with syntax:
Syntax: while(condition)
{
Block of statement;
Increment/decrement;
}
c) I will solve the following program and make students more clear.
Example: Write program in C that display the first 20 natural numbers using while loop.
#include<stdio.h>
#include<conio.h>
void main()
{
int c=1;
while(c<=20)
{
printf(“%d\n”,c);
c++;
}
getch();
}
Evaluation:
If you declare the initial value of c as 10, then what will be the output?