You are on page 1of 15

maA-

20 ond A Jo3npuui
Coun hou 2 wiheut
Ho manH

gnpsd N
R uÒS 2
Let X 2

let X L 20 n p i t
30 W X <= N
Let E 0 OX= X *2
Let O SO
hilz X <= 0 O lend
anumlea "; N_
Snput R =N -X
g N MoD 2 O hn E1 d
N MOD 2 hÁ O=Ot1 Paint"Quatrt= Q
Paint Parnond R
_X X+ nd
NendL
Print Numie euen
Pint Nuroerc
-
N T
PVS
p MO
27ro
dUM
o
U
6
d pru u
O WAP to nput a number ahd pruntt
a prme Aumber
or not
20
= 1 Ca
bALm N 30 Whil X<N_pd
Lnpu N m a d X > X=O then C C
201 Whle X<=N-1 nd
30 =
SO =X+
X wWend
R nt Nat a
M= N mdcd X dsu"elsiPunt "PAAe
Bo 9f 0
DM mod X = the Wend
20 End

Taput ler N-
M N
h h i l X <=M
a Mmad/Xa 0 tben Ca Ct
Wend
F2
s mod 25

WAP Ta Mapul0 S N*N


numl;N
hithua t Ah 20 M N
30
Whi M <z0
25 50 R Mmsd 1o
625 60 M M-R)JLO
D D+1
- 36 70
0 Wend

X GO E = 10^D
mlen 9 MSnod = N hon pabt
Sapt 100

ARunt pet "dadomasph


E

N *N nnmlea"
M =NN
))
auulonosargh-
nhil M<>0 L1o End
R =M msol 10
M= M -RYLO.
DON E DOM+1

taDON

)1o.
e W BaAL.
LLany Kunsdiens P f ocoluct and pait Ahu
Z Wbere z= Nhazty3) volu
GW BASICh a proLdedA g m e
dodnAiUe
Athan
C i e n J w e tapes s h u n t i s r i Jake he valAADA nandd yasrpu
t.
a )N u m i u i e J u n c d i e h s .
10 nput valuu e ' ; X
b)S.thing undiens
20 npuut aluu of y"
Numerc functhions 30 Z 5qr["2+ yk
PruintZ
lnnd
Sqr(n)=GuvesAhi sqahL hSt0 a 50
umle
or
TT Ca) Removesdecimal potión from pQAI
twe number_and removesdecmaL 10 Znpuut "valuu of &y"; X,Y
portiom r o e and q u e s h e t 2 0 Let S X*2
louwelt humbenA MLgawe nu 30Let R y^3
H0 Lct Z Sqr (StR)
So Prunt "Valuu o z ",Z
ARSCn)= Lieralls 4uust print the nLmber 60 nd
without_A9nd.

FunLn) a Baucally nemoves de.cuial pouil


Sqn n) antitist hn9A
neaatiu thun quue -1
a eCLnd
numb print
Cud ps WAP to ud a
9 uiAmumieni g
WoPta snput u duuiiie
ble y med..
1O 9nput N nput
20 M=N 20
3 0 w i l M<>0_ 30 R _lnt Q)
4O R= M no lo 40 R Khen pint "dinslt
ry 9
5 0 M= Tt(MID) prnt"nst
nd
nst diALUlely
60 D D +R
70 Wend
&0 Enad
tuw digilt mbeA
_pal
wk "o
2-dugt rwm', N
i t dugi addid a M - V

d g , hu R = M mod 10
dus c
dus
th ouguro2.dugt Lnt CM/1D)

59
P+S = N Jhar prt
5 G= u45 "hpwsl runioe
1445 =59 Eerd
ppArk"nop, tapal
P 1
npt 2iense " N WAP Jo npud 20 nurrbos and
Le M= N Lnt
hil M<z DII PAIiAe.

D-D+R IOFo A 1 ta 20
P: p*e 2 reUs "nt wsrhe'yl
M IT (M/LO) 3 Sqn Ln)
vlend O an prrtgoti
D+P hn prunt "Lpial Let P-P1.

USAlye" 69. Pnurt "Nur of poult urnlws-P


7 Prt " Nusnbo. ugptue Urrbus:l
WAP t RC rnd colu Stnisg undiom
lat th val
LEN(n$)=_ cs
D :-4Ac

alu
Jhan
D
cálculat
ualu thanio
RIGHTnf, a)= uies sight
R1 tVb-4AC Left $ Cn$nla Ruerie
Right $
npuut "ntun waliuA U
BC A;E. MID nl,n,mn)= Puuinthamnfo
Li D 8 2 - 4"A*C
D > O then d RiB +SarL
-4A*C)and
CHR$ nl O canAnent a
npd " ntu oluus o 4, 8 C"A;R:C ASCLL
alphalut
Let D E B2- 4* A*C
Pnint D ASC Cn) 4ui valiuu
D2O then R1- P+ Sar (D and
d p i t Ri
nd STR^U to cuenf

UPPERCASE
LOWERCASE 9 t122
PaLnÍ Lasn
slnings
npud tws stuing " Af BA WAP to npt a
LO Ynput TA
Aaepanate tig
uiis and puint e
(AL) >
2 0P LEN pawit BL
'LENB
npnat
Af ela
O
A

30 n A EN CA)
uod
and it uhe
L
pAAit t 20
30 for n = 1 t s A
nput a
input RACIC C R$ MIDf(An,n)
IC Go PRunt R
SLC 60 Nent_vL
ASIC 7 0 End
BASIC
10 n p u t "a wphd
N Wut a
20 A LEN[N and
and Arunt ADa palundrs

Eg nypud uSnd MADAM


50 Punt RI Outpuut: a paluadaom
GO Nent n
70 End 10 nRAt na a staiog", S}
20 fo X =
Lun (sf) to stip -=1
30 M M$(S$,X,1)

SoNent X
6O S$ = NS_then phunt } "u a palinde
else Phunt SS ne Apalund-
70 End
CeYt a WeP t o l n i n .
Onsgnam A
VAP a aall luttins And ond conu-
umrd
unid

=6 5 tt S Lput "entn O d:"icg


Cor
L 21 to Len
A LEN SS ts A
0
30 Lef SA ASC LC)
(MIDS CLCs,
Lon
40 S A =4C5 and SA K= I1D)
AS=
ASC
hLhile X < 9O and Ca
etUC -UCS +CHR$ (SA+32) 90_Thin
A>:9EOnd SA<= 22 thun eliiy
X = 32 UC$= Cg t CHR^ (SA-32) Elk Lt
nd UCS = UC + CHRS (SA) t

Paint US "s tocosd uworo


Nent
End
WAP to cccept A h hr na ndPt
nan
h N` = N +
MIDS g.zr
he iitial VontX
stingS} Prunt h
Lnput " Enten _a End Ating à, N`1K^
20 S Len(SgS)
30 X 1 WAP ta
2 0 M$=Mid SLS^,Xl) nput oll uin umbuu
een lOO ko Soo. Ltr
s +1, 1)+
GO Nemt_X inllial valu"jAL For b:1to es a
20
70 P i n t "Jh 0mod 0
30 Enad 30
9
b=
hn C-C+l
40 Nent b
ALLp_A non ndpnist S0 9 C 22 thon pLnr
WAPta na
th nitial Ai o; nst pine umlui el
10 npu " EnTon a s A d S5 b0 Nent a
SS' = t 10 Cnd
20
30 LenlSS
4O P E L
50 M$= MAS ( SS P1)
60JaLhile M<2"
70 A A P P= P-1
20 M Mid$ SS.P,1)
GO Wend
OO SS = L-P
110 feELet Kg- light $MS ss)
120 for X =_ to P1
136 M MA (SSX1)
250 o n 20cals collk
WAPte
put awsd paiatin
ar prir
net 60
bOp iör
each
gnput ntuumd WS
60p o ent GO M =Lelt (wt,1)_
40p each 20
r 2 0 0 call Nhal M <z'"A" AND
y
M{K'E" 0nd
30

Laile Y =**yu Castemin D


and M<7"T' ond M <"O"
16 AJOU *tntu
40
CCtlL and MEz
Y _ A < =80 thun- 250 elA SOM = MD¢ wC,1)
20
N = |40. Khn. ill= 2S0 6 0N e n d

3 _else S200 P Lenlhf)-C) t1


-80
t h n lill = so-60's(N-0g0 Pn t MDT (WI,L,Cc-1)+ Riaht (f,_
P) AY
6)C60*S)+LN90
2 nd
90 n d

Cusamn lD=y C$ WAP A_Naeut 2


30 Paunt umens ond print
uO PAnÍ Na. o calll - ' N_ th HCE
5 0 Paini "amsint e Lu pand Eg+ 8,6 HCF 2
60 nput " Z Y Jor centiu NoA At ange Small
70 Wend
20 End
HCF ute
Facto atiam Methsd: Long eision Method
A, B
10 nput Etin 2 numhers
kbun L- A els L-B
10 LretEnt
AB
2 n0.A,8
Then L-A
20
20 gA >B 20
30 a x 1 taL end elu L-B
Amsd x0 and B meol X0 30 R Lmoc S sA S= A
Thin HCE = X Whil R <>O
LS
SO Nemt X
60 Pruint HCE ",HCE 6O SR
10 End R Lmocd S
0 Wend
n gdwsim_melh.oc 90Punt:"HCF =S
OO nd
10 nput Ent 2ndmle A,R
20 Az thn_LZA _oed S-B_l
L-R ard SA
30 h i s R <>0
LoR =LmodS
S0 4R thun az HCERS-
70 S R
80 nd
90 Paunt HCE HEE
LaÓ End
WAP toLnput a chanact
netun it id a JouencO andpiut
UppeCu
O Ape.cia _chaactu o digit
UPPERCASE =E 65to 90
LolWERCASE =E 97 to122
DIGTIS = 2 to 5
10
20 9nput a
AS= ASC CA$)
charactn" AS
30
AS AS >= 65 and AS =90 thn
Apant A6"As ap zo nuPp,
AALJattin" sl AS =9 ond
HS <E 122 thun phuAt A^;AA AL
LALLtta " ll
AS = S Thn pint A AS 42 and
LLA LAA digit
PMAA ASi aApIcLAl chou
End

You might also like