Experiment Title: Algorithms and Flowchart A) Flowchart: Start

You might also like

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 13

Experiment Title: Algorithms And Flowchart

a)
Flowchart
START

Read
Num1, Num2 ,Num3,
Num4

AVE = (Num1 + Num2 + Num3 +


Num4)/4

Display
AVE

END

Pseudo code
Start
Read Num1, Num2, Num3, Num4
Compute AVE as (Num1 + Num2 + Num3 + Num4)/4
Write AVG
End

Output

b)
Flowchart

START

Read
Num1, Num2

YES
Num1 > Num2

Num1 = Num2

YES

BIG = Num1
SMALL = Num2

Write

These number are equal

NO
BIG = Num2
SMALL = Num1

Pseudo code

END

Start
Read Num1,Num2

If Num1 larger than Num2


BIG = Num1
SMALL = Num2
else
If Num1 equal to Num2
Write These number are equal
else
BIG = Num2
SMALL = Num1
End

c)
Flowchart
START

Read
INTEGER

Write
This is an even numberl

NO

INTEGER/2=0
START

Write
YES

This is an odd numberl

Pseudo code
Start
Read INTEGER
If INTEGER/2==0
write This is an Odd Number
else
write This is an Even Number
End
Experiment Title: Introduction to C Programming
1)
1
2
3
4
5
6

#include
main()
{
// Display Welcome to C to the console
Printf(welcome to C Programming);
}

2)

3)

Experiment Title: C Structures


1)

2)

3)
Flowchart
START

Read
MYR

write
USD =
MYR*3.2
USD
END

Pseudo code
Start
Read MYR
Compute USD=MYR*3.2
Write USD
End

Output

Experiment Title: C Structures


1)

Experiment Title: Looping


1)

10

Output

2)

Output

Experiment Title: Functions

11

Output

Experiment Title: Arrays

12

Output

13

You might also like