Monday 4 July 2022

C Programming - If Else condition - Session - 11 -Switch Case

 

The following is the chat and other information exchanged during the session-11:





Thameemul Ansari7:25 AM

int number;

switch (numbers)

{

case 1:

printf("One");

break;


case 2:

printf("Two");

break;


case 3:

printf("Three");

break;


default:

printf("Enter the numbers between 1 to 3");


}

Jameela a7:33 AM

#include<stdio.h>

void main()

{

    int num = 1;

{

    switch(num)

    case'1':

    printf("the value is ONE");

    break;

    

     case'2':

    printf("the value is TWO");

    break;

    

     case'3':

    printf("the value is THREE");

    break;

}

}

No comments:

Post a Comment