Semester : S1 and S2
Subject : Computer Programming
Year : 2017
Term : DECEMBER
Branch : BIOTECHNOLOGY
Scheme : 2015 Full Time
Course Code : CS 100
Page:16
04 clrscr();
05 printf("enternumber");
06 scanf("%d\t" i);
07 printf("natural numbers from 1to%d",n);
08 Ib: printf("%d\t", i);
09 i++;
10 18൦)
11 goto 10;
12 getch();
13 (
SWITCH
It is a multiway decision statement.The switch statement tests the value of guven variable( or expression) against a
list of "case" values and when a match is found, a block of statements associated with that case is executed. General
form of switch is
01 switch(expression)
02 {
03 case value-1:
04 block-1;
05 break;
06 case value-2:
07 block-2;
08 break;
سس 09
سس 10
11 case value-n:
12 block-n;
13 break;
14 default:
15 default-block;
16 break;
17 (
18 statement-x;