Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

ASSIGNMENT-1

DEFINITIONS:

ALGORITHM:

A procedure used first solving a Problem or performing a computation.

FLOWCHART:

Flowchart Is a picture of separate steps of a process in a sequential order

ADDITION:

STEP1: Start.

STEP2: Read n1,n2.

STEP3: Sum=n1+n2.

STEP4: Print Sum.

STEP5: Stop.

SUBRACTION:

STEP1: Start.

STEP2: Read n1,n2.

STEP3: if num1<num2
Print subtraction not possible.

Else

S=n1-n2.

STEP4: print S.

STEP5: Stop.

MULTIPLICATION:

STEP1: Start.

STEP2: Read n1,n2.

STEP3: m=n1*n2.

STEP4: Print m.

STEP5: Stop.

GCD:

STEP1: Start.

STEP2: Read n1,n2,i,gcd

STEP3: For ( i=1;i<=n1&&i<=n2;++i )

If (n1%i==0&&n2%I==0)

gcd=I

STEP4: Print gcd

STEP5: Stop.

FACTORIAL:

STEP1: Start

STEP2: Read,n,i,Fact=1

STEP3: if n<0

Print factorial of negative numbers doesn’t exist

Else

For( i=1;I<=n;++I )
Fact*=I

STEP4: Print Fact.

STEP5: Stop

You might also like