0% found this document useful (0 votes)
3 views7 pages

24 CP 48MuhammadRaheel0mega

The document outlines a series of programming tasks including adding three numbers, finding the largest of three numbers, checking if a number is even or odd, calculating the factorial of a number, and converting temperature from Celsius to Fahrenheit. Each task includes steps for input, processing, and output, along with flow charts to illustrate the logic. The tasks are designed to help users practice basic programming concepts and functions.

Uploaded by

raheel31102004
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views7 pages

24 CP 48MuhammadRaheel0mega

The document outlines a series of programming tasks including adding three numbers, finding the largest of three numbers, checking if a number is even or odd, calculating the factorial of a number, and converting temperature from Celsius to Fahrenheit. Each task includes steps for input, processing, and output, along with flow charts to illustrate the logic. The tasks are designed to help users practice basic programming concepts and functions.

Uploaded by

raheel31102004
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

LAB TASK 01

Q1: Add three numbers.


Step 01:

Get the input from user for three number, say a,b,c .
Step 02:

Add the numbers a+b+c .


Step 03:
Print the output.

Flow Chart:

Start

input a,b,c

a+b+c

Output Result

End
Q2: Find the Largest of Three Numbers.

Step 01:
Get the input from user for three number, say a,b,c .

Step 02:
Compare the numbers using conditional statements OR using the max
function in C++.
Step 03:

Print out the result.


Flow Chart:

Start

Input A,b,c

a>b ?

a>c ?

.......

Output

End
Q3: Check Whether a Number is Even or Odd.

Step 01:
Get the number as input from the user.

Step 02:
Now divide the number by 2. If remainder is 0 then the number is even and if 1
then the number is odd.
Step 03:

Print out the result.


Flow Chart:
Start

Input x

x%2

No
x%2 = 0? Output Odd

Yes

Output Even

End

Start

Input x

x%2

Q4: Calculate the Factorial of a Number.


Step 01:
Take the number as input from the user.

Step 02:
Multiply the number with its decrement by 1 until the number isn’t decreased
to 0.
Step 03:

Print out the final result.


Flow Chart:

Start

Input n

x=1

x = n*x

n= n-1

No
n=1?

Yes

Output x

End
Q5: Convert temperature from C to F
Step 01:

Take the input from user.


Step 02:

Use the formula to convert it:


F = (Co *9/5) + 32

Step 03:
Print out the result.

Flow Chart:

Start

input C

F = (C*9/5) + 35

Output F

End

You might also like