You are on page 1of 5

Lab Report # 04:

Lab tasks
In lab task:
TASK 1: Write a C++ program print total number of days in a month number entered by
user using switch case.

TASK CODE:

Page | 1
OUTPUT:

TASK 2: Write a C++ program to check whether an alphabet is vowel or consonant using
switch case.
TASK CODE:

OUTPUT:

Page | 2
TASK 3: Write a C++ program to create simple calculator using switch case.
TASK CODE:

OUTPUT:

TASK #4: Write a C++ code using switch that takes int number 1-9 and print its English.
TASK CODE:

Page | 3
OUTPUT:

Conclusion:

Page | 4
Conclusion No. 01:

Name: Amna Sohail


ID: 190945
In this lab we were introduced with "switch statement". We learnt its syntax and its usage in
programming. Switch statement is a multiway branch statement. It provides an easy way to
dispatch execution to different parts of code based on the value of the expression.

Conclusion 02:
Name: Khansa Naz
ID: 190321
In this lab task we learnt about switch statement and its use. By using switch statement, we
can write more clean and optimal code and it works only with integer, character and
enumeration constants.

Conclusion 03:
Name: Shamamah Batool
ID: 190333
In this lab we learnt how to use switch case in C++ program. It is an easier method of
problem solving in programming.

Page | 5

You might also like