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

Lab 1

The document outlines a series of exercises involving conditional logic and mathematical calculations. Each exercise includes a flowchart-like structure for input, processing, and output, covering various topics such as finding minimum values, determining point locations relative to a circle, solving quadratic equations, and calculating averages. The exercises also address specific conditions like leap years and factorial calculations.

Uploaded by

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

Lab 1

The document outlines a series of exercises involving conditional logic and mathematical calculations. Each exercise includes a flowchart-like structure for input, processing, and output, covering various topics such as finding minimum values, determining point locations relative to a circle, solving quadratic equations, and calculating averages. The exercises also address specific conditions like leap years and factorial calculations.

Uploaded by

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

Exercise 4:

Start

Input a,b, c

False True
a>c
Min = a Min = c
?

Display True a>b c>b False Display


“Min is ? “Min is
?
b” c”

False True

Display “Min is Display “Min is


a” b”

End
Exercise 5:

Start

Input x, y, R

D = sqrt(x*x +
y*y)

True
R=0 Display “Choose
? another radius”

False
False False
D=R D>R Display “Point A
? ? is inside the
circle”

True
True
Display “Point A Display “Point A
is on the circle” is outside the
circle”

End
Exercise 6:
Start

Input a,b, c

False True
a=0 Display “Choose
del= b*b – 4*a*c ? another number for
a”

False False x1 = (-b +


del= del<
0? 0? sqrt(del))/(2*a)
x2 = (-b -

True True

Display “x1=x2=”- Display “No


b/a solution”

End
Exercise 7:

Start

S=N
C=1

Input string
N

N= False S=S+N
Display N C=C+1
“Stop”

True

Ave = S/C

End
Exercise 8:

Start

Input a,b, c

a=0 True
Display “a, b, c must
||
be different from 0”
b=0

False

m = sqrt(a*a + b*b)
n = sqrt(a*a + c*c)
p = sqrt(c*c + b*b)

a=b False (a=b && a! False c=m && False


&& =c) || a=b
(a=c && a! c=m && a!
a=c =b) ||
a=p &&
=b
b=c
a=p && b!
=c
True True
True

Display” This Display” This Display” This True


triangle is triangle is triangle is isosceles
equilateral” isosceles” right-angled”

Display” This
triangle is right-
angled”

End
Exercise 9:
Start

Input grade1, grade2,


grade3, grade4

Ave = (grade1 +
grade2 + grade3 +
grade4)/4

False
Ave True
Display “Fail” Display “Pass”
>=6

End
Exercise 10:
Start

Input a,b,c,d,e,f

X = (c*e – b*f)/(a*e –
b*d)
Y = (a*f – c*d)/(a*e –

Display
“a is”,
a,
“b is”,
b,
“c is”,
c,
“d is”,
d,
“e is”,

End
Exercise 11:

Start

Input Y

Y%400 False Y%4=0 False


&& Y Display “Not
=0
%100!=0 leap year”

True

Display “Leap
Display “Leap
year”
year”

End
Exercise 12:

Start

i=i+1

Input N T = N*(N – i)

True

False False
N<=0 N=1 i=1 I<N

True False

Display “Choose Display “1” Display “factorial of


another N>0” integer N is” T/pow(N;i-
10)

End

You might also like