0% found this document useful (0 votes)
40 views5 pages

What Is Algorithm?: Pdpu, Gandhinagar 03 List of Programs

An algorithm is a step-by-step solution to a problem written in plain English. A flowchart is a pictorial representation of an algorithm that shows the general plan, architecture, and essential details of solving a problem. The document then provides examples of simple programs to write algorithms and flowcharts for, such as adding or subtracting numbers, and examples using conditions and loops. It also provides array examples such as accepting values into an array and printing them.

Uploaded by

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

What Is Algorithm?: Pdpu, Gandhinagar 03 List of Programs

An algorithm is a step-by-step solution to a problem written in plain English. A flowchart is a pictorial representation of an algorithm that shows the general plan, architecture, and essential details of solving a problem. The document then provides examples of simple programs to write algorithms and flowcharts for, such as adding or subtracting numbers, and examples using conditions and loops. It also provides array examples such as accepting values into an array and printing them.

Uploaded by

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

PDPU, GANDHINAGAR 03 List of Programs

What is Algorithm?
It is a step-by-step solution of a given problem.
It is written in plain English.
With the help of algorithm one can easily draw flowchart or write
program.
What is Flowchart?
A pictorial representation of an algorithm is known as Flowchart.
It is like a blueprint which shows the general plan architecture and
essential details of the proposed structure.
It is a diagram of the se!uence of steps involved in solving a problem
prepared by the programmer.
It describes the comple" processes into a flow diagram.
Flowchart Sm!ols
" Darshit Shah #
PDPU, GANDHINAGAR 03 List of Programs
#$ WRI%& ALG'RI%H()DRAW FL'W*HAR%) WRI%& *++
PR'GRA(S F'R %H& F'LL'WING$ ,SI(PL& PR'GRA(S-
#. Add two numbers.
$. %ubtract two numbers.
&. 'ultiply two numbers.
(. )ivide two numbers.
*. Add multiply subtract and divide two numbers.
+. ,onvert hours into minutes.
-. ,onvert minutes into hours.
.. ,onvert dollars into /s. Where # 0 1 (. /s.
2. ,onvert /s. into dollars where # 0 1 (. /s.
#3.,onvert dollars into pound where # 0 1 (. /s. And # pound 1 -3 /s.
##. ,onvert grams into kg.
#$.,onvert kgs into grams.
#&.,onvert bytes into 45 '5 and 65.
#(.,onvert celcius into Fahrenheit. F 1 728* 9 ,: ; &$
#*.,onvert Fahrenheit into celcius. , 1 *82 9 7F < &$:
#+.,alculate interest where I 1 =/>8#33.
#-.,alculate area ? perimeter of a s!uare. A 1 @.$ = 1 (@
#..,alculate area ? perimeter of a rectangle. A 1 @95 = 1 $ 7@;5:
#2.,alculate area of a circle. A 1 $$8- 9 / 9 /
$3.,alculate area of a triangle. A 1 A9@8$
$#.,alculate net salary
where net salary 1 gross salary ; allowance < deduction.
Allowances are #3B while deductions are &B of gross salary.
$$.,alculate net sales where net sales 1 gross sales < #3B discount of gross
sales.
$&.,alculate average of three subCects along with their total.
$(.%wap two values.
/$ WRI%& ALG'RI%H()DRAW FL'W*HAR%) WRI%& *++
PR'GRA(S F'R %H& F'LL'WING$ ,USING IF *'NDI%I'N-
#. Find out largest and smallest of two values.
$. Find out largest and smallest of three values.
&. Find out net salary where net salary 1 gross salary ; allowances <
deductions.
If gross salary D #3333 allowances are #3B deductions are &B
If gross salary D *333 allowances are -B deduction are $B
(. Find out whether a given no. is divisible by - or not.
*. Find out net sales where net sales 1 gross sales < discount.
If gross sales D $3333 discount is #*B
If gross sales D #3333 discount is #3B otherwise *B.
" Darshit Shah /
PDPU, GANDHINAGAR 03 List of Programs
+. ,alculate total average of marks of three subCects. 6ive following grades
to the student.
If average D1 -3 distinction
D1 +3 first
D1 *3 second
D1 &* third class
Etherwise fail.
If student secures F &* marks in any subCect then declare student fail.
3$ WRI%& ALG'RI%H()DRAW FL'W*HAR%) WRI%& *++
PR'GRA(S F'R %H& F'LL'WING$ ,USING L''P-
" Darshit Shah 3
PDPU, GANDHINAGAR 03 List of Programs
#. =rint #
st
#3 natural nos.
$. =rint #
st
#3 odd nos.
&. =rint #
st
#3 even nos.
(. =rint #
st
n natural nos.
*. =rint #
st
n odd nos.
+. =rint #
st
n even nos.
-. =rint sum of n natural nos.
.. =rint sum of #
st
n odd nos.
2. =rint sum of #
st
n even nos.
#3.=rint factorial of a given no. e.g. *G 1 *9(9&9$9# 1 #$3.
##. =rint your name * times.
#$.=rint your name n times.
#&.=rint sum of all nos. divisible by #& in the range of # and #33.
#(.,alculate sum and mean of any #3 values.
#*.,alculate sum and mean of any n values.
#+.Find out largest and smallest out of #33 nos.
#-.,ount ;ve-ve and Heroes in $33 values.
#..Find out how many boys and girls are there in a class of *3 students.
Input se" code.
#2.=rint all integers from # to #33 which are divisible by *
$3.=rint sum of all integers from # to #33 which are divisible by &.
$#.%eparate digits of a given no. e.g. &*#I#*&.
$$.,ount how many digits are there in a given no. e.g. &*#-&.
$&.%ummation of digits of a given no. e.g. &*# 1 #;*;& 1 2
$(./everse digits of a given no. e.g. &*#I#*&.
$*.,heck whether a given no. is palindrome no or not. e.g. #$&$#.
$+.Find out whether a given no. is armstrong no. or not. If sum of cube of
digits 1 no. itself then it is the armstrong no. e.g. #*&.
$-.Find out factors of a given no. e.g. +-#$&+
$..Find out whether a given no. is perfect no. or not.
If sum of factors upto half of a given no.1no. itself then no. is perfect
no. e.g. +1#;$;&1+
$2.,heck whether a given no. is prime no. or not e.g. -###&#-.
&3.Find out all prime nos. between #and *33.
&#.Find out summation of prime nos. between # ? *33.
&$.Find out how many prime nos. are there between # and *33.
&&.,heck whether a given no. is automorphic no. or not.
Automorphic nos. are the nos. whose last digit7s: of s!uare of any
no1no itself. e.g. *-$*+-&+$*-+$*
&(.=rint fibonacci series. ##$&*.Jupto n nos.
" Darshit Shah 0
PDPU, GANDHINAGAR 03 List of Programs
&*.=rint the following series. 7loop within loop:
7A: # # 75: # # 7,: # # # 7): * #
# $ $ # # # $ * $
# & $ $ # $ # ( #
$ # & # # $ $ ( $
$ $ & $ $ # # & #
$ & & & $ # $ & $
$ $ #
$ $ $
&+.=rint the following series 7=arallel loop:
7A: # * 75: # *
$ ( # *
& & $ (
( $ $ (
* # & &
& &
0$ WRI%& ALG'RI%H()DRAW FL'W*HAR%) WRI%& *++
PR'GRA(S F'R %H& F'LL'WING ,USING ARRA1-
#. Accept * values and print them later on.
$. Accept #3 values and print (
th
-
th
and 2
th
value.
&. Accept * values and sort the array in ascending8descending order.
(. =rint minimum no. of notes re!uired. >otes given are # $ * #3 $3
*3 #33.
e.g if value is #$*+ then answer is #$ hundred-rupee notes # fifty-
rupee note # five-rupee note # one-rupee note.
*. ,onvert figures into word. e.g. 22-ninety nine.
Assume number to be between 3 and #33 only.
+. =rint month name of a given month no. e.g. & - 'arch.
-. =rint month no. of a given month name e.g. April-(.
" Darshit Shah 2

You might also like