0% found this document useful (0 votes)
18 views25 pages

DSA (Part1)

Uploaded by

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

DSA (Part1)

Uploaded by

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

iht main

int manUluh om

(ode

code)
Edopemain

+ring

Jytan

# i n d ud e < i i s h e a m

Headex &e

endl

Gihahon hoh hai

USg hamesaLe Stdi


's
&reyng int mais cli.
Caur" HUuo

inpu.
cin

usca-iinc

Suiltin primihve
Unio

CI9sse S.
POinteKS
void
inicgex

loat

Ibit ’0/1,
13 cGmplement

O000\ -I0
\0 10 10 -01010|
|Il000o - 000o \II
Loi|LO-0\000o\0 10|.

ghore
ind inarg ey
tave 2'1 conQlemen

ecamele.

Binary O0000000 O0000000 O0000000 0000 Iol

aåd 1.

Chax ’ 6it.

: 256
total
’ 4 butc 32 bit

Aotal

nt int

" ASigment ,<:,>:

Gitwie, cdoube doub)

Enput
ie Decimal stem

t Decimal t0 inharg Coh veKSion.

wiL be a bit ih bin er mo).


atote mln dex lhat
quoHeht
2)
Sepeat bove te wh the Quoke Unil
bits So

3emindex

ins deimalTo Binay Cint n .

binuoy mo bit * Pow o ] t binang no


m n/a;
S

(smdihonal

L while

c o n l i h o

Updohio,

dox (int i= 0; i<i0i=i+)


hesed o« toopa

ox Cint i 20 i«3i it+).

Patexh Psiningtt
+ Squas Pattesn

Yow 1

3 t * * * *,

nai)

4 eta 2
dox (im i B0; i<4i i++)

coUt *"i

OU4eK- 3

5
Star xiNt :.

2
S &tar·
3

Box (int

Cise
yoxin col20

Ciol : 0 | | col z4)

eise Guutd"
-*

X0W- 5 n. Psiht

23 4

-I?34(na)

int ni
Cinsn.

I.
hatd Psymid

23 4 S
33 4
(n-row)
-| 2 3
- ?

3.
Holow Invexed pyscmid

cihs hi

Gout"
Ful Pyramid.
O wn S.

Lol

eak bad shi ek Jace


Tnuested Pigamid.

COUt <" "

Same code Raate.

iht
nz nunn21
Hollow Punni

Y*.

dox (int

3.
Inveted V

or (int dw0; t0<hi kow t+).

o Cint (ol 20i col «ow; colt+)

-)

3
J.

dian ond )
or(int col 0; col<2toy;co \ tt)

3.
CoUt<ehel

3.

3.
34 34 3

3chat
- Schar

S3-7ha

*ow+)

.
dang Patten

Cout

anty patterh.
Given mo i
3tonc in

* eveh
s(Na): 0)
eveh
eise
ode.
y’oloo

od.
bool check EvenCint m)
y(cn1= =6)1.

setUn alse

nt main c)
iht ni

bool even checleeven c )

3.
4ctoKlal
int gact Cint n)

Cint i = l ; ( « h ; i 4 4 1

i
act = &act

ina moi c1.

3.

sime mo ox mot
bool cheek Poimelint m).

toy Ci2; i a h i t ) .
( n i 20)

3.
int ma c)
it main c).
int
Cin> mi dox Lint i22;iahiit)

checiepsime Cn
bool is Psime
4 Cis Paim e). (ispime)
caUt i
eise {. 3
not a im

3.
Bitwis Stentok
opckatox

uniaue element

S.$.10

00 000010

O000oo10O

A
o00000 o 00000000 bo00000\

to Keod mS, we ntave

COm ’ oo00 0000


O00 bo 000 0o00000ò ooð000o
O000 0000
9.
Do0000 O0
O00000 oo odoo0 o10

S o0O0010I WOxKS bit

S 00 000101

1S
<A..

Righ Shigt
KiSi bhi no
ho nai

mot Lompu\sasg
S>>.

O000 t bit

(ase hmai no sighe &hit


Shi o/ de hai
unihed 1ce (asc mal tve large no D/P

Gasbaye Valut.
gasbuy < Valve ah
hai
Anc /dcexcment OpeKutOg

ost - dvecencnt a --

Phcic incremcnt I<rd'.


hi

int a = S,
(20

121

IKe bhar

O,2.3 4,S.
contihue;
Variobie Swging
Local

S cop o

can'

Pxecccdehe table

Use bsackei *

((2*3)+ (ho))-.

(6 tos)-R.
Variayic

nym

2 S. S;
104+ nu

Che h Chas int.


in a= tli

E'uplit Type conves aien.


manval T0 comves Si oh,

yoat
15.0

int/in ’int
in0at lou

You might also like