flowchart (1)
flowchart (1)
• flow chart:
• flow chart is pictorial
representation of step by step
solution of a problem.
Q: to calculate simple interest
start
1. input: p,r,t
2. si=pxrxt/100
3. print si
input: p,r,t
si=p*r*t/100
print si
stop
Q: Calculate area of a circle start
1. input: radius
2. area=22/7*radius*radius
3. print: area
input: radius
area=22/7*radius*radius
print: area
stop
start
stop
Q:draw a flowchart dipicting
process of sign in
Q : display larger
numbers out of two start
number
input: num1, num2
1. input: num1, num2
2. if num1>num2
print num1
3. else true if false
print num2 num1>num2
end
Q print table of a number start
1. input number
2. i=1
3. repeat for value of i=1 to 10 input num
print(number*i)
i=i+1
i=1
loop :
1. condition based
2. looping variable based
false if i<=10
true
t=num*i
end i=i+1
print t
Q input age print
1. if age is > = 18 then print
that you are eligible to vote
if age<18 then print you are
not eligible to vote
Q take three numbers as input start
and find smallest number.
1. input three numbers
a,b,c
input:a,b,c
2. if a<b and a<c then
print smallest number is a
3. if b<c then
print smallest number is b
4. else: False if a<b true
print smallest number is c and a<c
stop/end
Q take a number as input and
find it is even or odd start
%-modulus ,= , ==
input: num
1. input a number: num
2 if num%2==0 then number is
even otherwise number is odd
false if true
num%2==0
end
Q take two number as input, start
first lower limit and second
upperlimit and add all odd
numbers between the two input: ul and ll
1. input ul ll
2. i=ll, sum=0
3. repeat steps for value of i ll i=ll , sum=0
to ul
if i %2!=0:
sum=sum+i
i=i+1 if true
i<=ul
false if true
i%2!=0
false
stop sum=sum+i
print sum i=i+1
Q take value of x and n as start
input and calculate sum of
series. input x,n
sum= x1+x2+x3........+xn
where n is an even number sum=0,i=1
1. input:x,n
2. sum=0,i=1 false true
if
3. repeat steps untill vlaue of i<=n
i<=n:
sum=sum+x**i sum=sum+x**i
i=i+1 print: sum i=i+1
4. print: sum
stop
start
Q take a number as input and
display if it is a prime number
or not input: n
i=2
print number is
not prime
end
start
Q take two number as find out
if number1 is divisible by
number2 or not input: n1, n2
if
n1%n2
true ==0 false
end
start
Q take quantity of pencil from
user. A pencil costs 10 rupees.
Shop will give discount of 10% input: n
if the amount is more than
500.Display total payable
amount after discount. amount=n*10
if true
amoun
t>500
d=amount*10/100
false amount=amount-d
print: amount
end
Q take marks as input and
show grades with following
rules:
a. Below 25 - F input: marks
b. 25 to 44 - E
c. 45 to 49 - D if
d. 50 to 59 - C print: grade
marks<2
e. 60 to 80 - B F
5
f. Above 80 - A
if end
marks>=25 print: grade
and E
marks<=44
if
marks>=45 print: grade
and D
marks<=49
33. draw a start
flowchart to
display i=1.j=1
following
pattern:
if
* i<=3 stop
** i=i+1
*** j=1
change line
i=row,
if j<=i print *
j=column
j
* 1,1 j=j+1
* 2,1 * 2,2
i
* 3,1 * 3,2 * 3,3
33. draw a start
flowchart to
display
i=1, j=1, k=65
following
pattern:
A if i<5 stop
BB
i=i+1
CCC j=1
DDDD k=k+1
line change
print: chr(k)
if j<=i
chr(65) j=j+1
33. draw a start
flowchart to
display
i=1, j=1, k=65
following
pattern:
if i<5 stop
A
i=i+1
AB j=1
ABC k=65
ABCD line change
print: chr(k)
if j<=i
j=j+1
chr(65) k=k+1
33. draw a start
flowchart to
display
i=1, j=1
following
pattern:
1
22 if i<4 stop
333
i=i+1
j=1
1 line change
12
123 if j<=i print: i
j=j+1
33. draw a start
flowchart to
display i=1, j=1
following
pattern:
j=j+1
Q take user choice as input start
“input 1 for area of circle and 2
for area of rectangle”. If user input: c
gives 1 as input then take
radius as input and calculate
and display area of circle. If if
input:r
user gives 2 as choice then take c==1 true
length and breadth as input
from user and calculate and false area=22/7*r*
display area of rectangle. r
for any other input display true if
invalid input input: l,b c==2
print: area
false
area=l*b
print: invalid input
print: area
end
start
Q take user choice as input,
also take two numbers as input
“input 1 :add input:a,b,c
2: sub
3: multiply
4: div if
5:exit r=a+b
c==1
if
r=a*b
c==3
if
r=a/b
c==4
if
r=a/b
c==4
if
Write a program to take number of days class attended
as input and display attendance in percentage. Total
number of days class was held is 222. If percentage is
75 and above then show you are eligible for exam and
if it is less than 75 then you are not eligible for exam.
34.Write a program to take a
number as input and display all
even numbers from 1 to that
number.
37.Write a program to take number of items as input,
then take price for each item as input.
calculate the amount.
if customer has silver membership give discount of
2.5%
if customer has gold membership give discount of 5%
and if customer has platinum membership give
discount of 7%
37.Write a program to take a start
number as input and display it
factorial.
input: n
i=1, f=1
false true
print f f=f*i
if i<=n
i=i+1
37.Write a flowchart to take start
number of items as input, then if
take price for each item as input:n input:p
i<=n
input.
calculate the amount. i=1,amt=0 amt=amt+p
if customer has silver i=i+1
membership give discount of
2.5% print: enter 1 for silver
if customer has gold 2 for gold
3 for platinum
membership give discount of
input: m
5%
and if customer has platinum
if
membership give discount of amt=amt-
m=
7% =1
amt*2.5/100 print:
amt
if end
amt=amt-
m=
amt*5/100
=2
if
amt=amt-
m=
42.Write a program to display start
sum of following series where
n is even number: input x,n
S=x2/2!+x4/4!+x6/6!……+xn/n!
sum=0,i=2, ,j=1f=1
false
false true
if
i<=n j<=i
true
f=f*j
print: sum
j=j+1
stop
sum=sum+x**i/f
i=i+2
j=1,f=1
Draw a flow chart to take a
number as input and check if it start
is positive or negative number
input: num
true if false
num>
=0
stop