mmt-001 17 10
mmt-001 17 10
i=1
False
Is i<=0
True
Print i
i++
stop
Draw a flowchart To print 1-100(do..…loop)
i=1
Print i
i++
True
Is i<=100
False
stop
H.W.
• To print multiplication table of n number.
• To find sum of 1to 100.
• To find sum of 1 to n.
• To find sum of m to n.
• Difference between while and do..while loop.
switch- case
• Syntax:
switch(expression)
{
case value1:code to be executed; break; optional
case value2:code to be executed; break;optional
default :code to be executed if all cases are not matched;
}
Array
• An array is collection of similar type of data items stored at
contiguous memory locations.
• An array is a derived data type.
• An array is used to represent a list of numbers , or a list of names.
How to declare it.
datatype arrayvariable[size];
Example:
int ar[10];
Array
Representation of an array
0 1 2 3 4 5 6 7 8 9 index
3 5 4 5 6 8 9 2 4 6
ar[0]