0 ratings0% found this document useful (0 votes) 23 views10 pagesIteration - Loops 3 Lyst8801
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here.
Available Formats
Download as PDF or read online on Scribd
Day ino L¥erations : Loop 5 : «EE
Pactorr of G@ number — Any no. which
see at pltely divide N. q
ON ienOn Cc ieomenpon on
a ae
37> 1,57.
ay Ng Obeao. « prant oll fa ctorten of fe
0/0 ;
6 1,2,3,6 Geis ieee of
‘| sesh everey numberz.
Citta cle erie of 0 foie,
int n= 8e.nerct IntC)
or Gini anes Gao tet
if Cnyi==0)f
S.o.ptn Cid;CY) Print oll the foctors of 0-
int n= go-nect Lat QO;
Pe Geto kaa
12 Unchi==0) ¢
3.c-pln Gi
° Prdame Numbers
A numbert (+e) oth only Q factors Ce
no. ixaelh). € actly Q! hactores.
factors,
Namloetcs
Creve) with more han tear
prame on om
cime NO-
© Compani te
A numiett
4 ip coltharc
Oe oe Smallead pr
ponite-
n eekorus status
Sy Ay 3, L359 Componite
4h Keane Prime
Q) Given 2 popr rive moo m Cow EON
Find if the n0- Ve Prams OT com Ponite-
if Ccound oh foctercs =,-2) ¢
Ora me
eine L
Com posi te
}f Q> Prime Of Com ponite . ee cf
new Soonn exc CSqatemin)i
Seanner St =
int n= ge-neckint Os
nde) teases fon 3
i eauOncomen ent SO Finthnemnbes incpaitnse
Dero Cinta eini— ay 143) (5U9
if Unei==O)f erufeore.
count ++i Ii ipa doctor ohn
CGRP Taos she too oli ia
i System out print U'No. of foctors ="
erate I} count in storing the ee
ane b ‘
° ie if Cn== 1) 5
Gauihan, oy hectares of 0 Nebel
neithert primey nom composite )i
elne (2 Coount = q) 4 4
8.0. ply C'Nuembur ib prame Me
nether
elbe {
S.0. pin ("Number i6 com pohi te.');
3
Bose cone not included.
The numberc wit) Near Yon
ore squal Yo OF
lohen Gor frome to Atarct becom
|
i een what ao you do? e]
4 beacomen Sie ‘Geke Coke. s
Bihan te be hondted q&
Seporoie : ~
i .
; .Counting th ]
Q 1g the number of Ai wn ONW {
Q) iat N= B456R: ee iS) cor maha
iat Count=O} 3h ava 4 Hee
Be tte sung 2 35 |
Count ++ 5 Sb 4 Se
} aS
8.0: Ln 6 Ree oe 6
is Oo YX fooploreake
BY 4
Sava
) The \sop ui) nevere ©0-
° breale * ger out of a Joop:
continu. next \texcatio
Print < all non. TV n excep
5 for Cet ae! t
5 ‘ea
it C=
Cont nue?
g,0-pln Gi
5for Ciat i=1) 1¢=10) i++) §
(© Use b sbinae){
Cont cue 7
4
Synterm.oat-priatln Cy
3
! @ public stahic void main ( Saring onan C 1)
5
A) AN nos. from £ Yo Ie
BY) AN nog. from 1 %o (0 excep) 4&G,
2) Compilation Errore
) Cnty 4 ond 6.
» hore Ginr Ree eel
onion
Con que: i 1 £210 loop
° (wore
oe L ne nt
So.pln 1) Q x )
c ei. 8
» 10 exoop?
eo
°
> AN A. brem |
% pe
4X6. 7 .
Be i
x W
& 8
y Q
x
{
sLoop breaksob te fovowing ‘bp not & Prame
QS Which
Numbett Q
fl 1%
B wav
may
9
° Arc e (a 9)
19 Q Commen Nactorcs
)
ce
ona Common hackers
fe) ACA A ae max
Hee = , po}
1 Ps i
S ate G) = ge. next Lnt OQ;
int b=Se next int O;
Mt Stork = 1;
int end = min (0.b)}
mat nef! = % pi a
act =A, <= ends 1+) ¢
MaCai--0 && be i==0)4
heft ati Mehooging Ka 1} con be Highsal 4
3
Sap ny Chef);
5Q=s bad
3 Vco=8 he'f
4 1 4
rs + 2
% + —
4 i 4
by t 4
6 me
1 q a
& a =
9
Peop braaks
Grd ACO) chases Given) Miter bers
int min = 07
if Cac) {
min=a;
Bj
eine }
min= b;C) ink q = sent int Oj
ind b= Se-neetint O;
I Pind min of a and bo
int min = Oi
iP cach) t
min =i
§
eaNCaN
mit = bi
4
£=0; ar ee
ee ene Vo=mini tt) &
iL Cathic=0 && be/--=0)f
nef = ti
Go olin Cacti
Oig@ MC howest common multiple)
gig... &OM=19
eeprom. «510,15... LOM=10Qa b
Gre loys gee!
Smallea? mult ple oly n=n
| {) mane Ca,b)
| 9) tinal first com mon multiple
“alg
ome
inl max =0
if Ca>d 6) §
max = a)
ic
else ,
max = b;
int lem=OF a
ee ee GSO an Cen r++) f
1 Ci tha ==0 && 1% D==0)F
5 Vom =
brea ki
S.0.9tn Mem);
iReel =
fo}
Wy) QC
commen multi ple updos «
f 8
8 i q
( £ 10
Q £ na
a 6 ns
\o +, braak
ofp > 49
Gib o deo tore oh x-
xe in & multiple ob 4-
é
© Mow to Toke tent AabEK *
igiet — Kenext it Oi
em. (tro) 4
If work
toni
3