0% found this document useful (0 votes)
10 views11 pages

Programming Basics and Algorithms Guide

C programming notes

Uploaded by

scts507
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)
10 views11 pages

Programming Basics and Algorithms Guide

C programming notes

Uploaded by

scts507
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

100marRs.

2 2 A I E O|

Pracem sowing Programmning


years ovd y sister is s5 years
4am go sis teY was borm
siste
etder than me, when my o Cr
3o years30+35
my father waS
my fathers currert a g l csy
what is Gorn2
fathers was, when 4
) How ol mg 3o+535)

j9%cA 30 + 5 a w s s s

MSA = MCA
+35
McA
FcA =
M
MEcA =

solve it Gy compter.
Bosk

VRG Oromey :How to


yo
Homework Have found an ec Programming book
on internet then what is 6ook name an
authornanti

The c Progranming larguage (488


Bria WkERNIGHHAN.
authors
Dennis MRI TCH E s
4ead Fistc'"
grtfiths
uthovs: David Gritfiths and Daor
ilas

Peblem-Dfinition Phase
Ounestand: what mst 6z done ather thn
than how to start
MnemticaySap tuoo numbe
nto 9y 5
A sohi saCna
Get a Values tTom e namely
Variabe
9 bet t is a
into t
3 copY the vhlue of x
Copy y ulee in to x
+
5 Copy t alee into y

hecÊ whether the given nunber d


posti
sal- Algorithm
1-bet Gea Varnalle
2Rea Nalue for x
3. check if xx is greater than zero. if
(ornt z is a so
pos1ive nunGer sotw
4 otheriise, pint x is a negative
nunber.
check even co) o d s e m

EVen
else
od.
et nyn isaarialei
Value, of nim
otsro

2 check the remainoer when num| 1S

remainder is Ze ro then num


is a even num oer,
5 otherwise it is a d nunber
WA
numbers
PSum of 2

So Read aCues foraG


adition ofa
oith6 and
Sperform
storeinc
Ceee from
printt6e addet va
nunbers
Sumation of nn
VanaGca
ngse a
O het
ct value of n from usr.
bers wer
nnum
For sum o
s= n t thrnso
Gave 2

J a a d d ths formula
to
Sm of
Anow print s
n nunGers.

ro tnto wm
2pace
3Rea n f r o n user
in from weer

aitionef sum with


S Perform
Repeat step+estepS fer n humay
7: print the alue ef Sumu
Flowchart Synols

SymGoC e
Name enotes begainin
oVe

7 änput
input operation
ectongle process to be
Carried
ot
Diamond
made

|hy6ri - outpt operation

Aivection of Cogicfla
0Ft c Flouwchart
1- dnput Lft stant)
2. LemLft x30
3print Lem érput

|Leme-fes
Adition o twonumoy print
Lem

sumntn2 stop
3 print sum
stert
ánput Sune-naintsu
stop.
num6en wich is grete
Given two
Bstat
gnput Aand
2check A>B

egulto
ad
alio
Yes
A>B

rintce)

stoe
heck if aRrsen is eCigicle to Cast
t Vote o not ÔNaw flouchart

start
ageziges

erint
Wineligie

stop
algorthmand
wso calculate the roots
that
equaton axtbxtc -o.
Hinti d=64ac, and the roo ts
andzG-a

a
4. print z are oots ofem

start anpt

stop Print
Aeck amon above jZ2
whichis grest
start Input
GabApr
Acbivcty-Ises

lowchart

start)

Snput
[Link]
rrogr
eAssitorn of too
two G)net
positive

gven no ais
pchece

>18 er) not


age
of quadrtic equhon
roots
numbys
greatest of two
3 numGer
Aveage of
fseudaoddeid

/negatie
te
positve

©eheck
Declare Integer:numer
START

INPUT numbey . THEN

n u m b e r > o

numoer
At
IF
TPUT
Ros itive
oU
ELSE
o U T P U T " n e g a t i v e

JonC19
END I F

END
3 numbors.
Greatest among
START
DecCare Integer: a6c.
INPUT ab C
THEN
aC
a>AND

IF
a i s the grectet
oUTPUT
Gzc THE N
AND
ELSE I F
6is the greatest'
OUTPJT

ELSE e a A N D G HEN

gretest.
oU TPUT c is the
END IF
END
Greetest among 2 nunbers. TAATe
START
Decare Variables a b' I n t e g Y t n

IF asb THEN

oUTRUT'a is the greatest'!


Ga THEN
ELS E IE the t
g r e t e y

oUTPUT"6is

ELSE
O0TPUT Both ae

END IF

END
PrintMessage for N Times.

START
As)ays
Decare Ni; intege rae

RE PEAT

Prent"Goat Moring"
UNTTL i<N

END
Sun pto N numbes.
START
DecoreSi:integer
SET sunO

REPEA T
Sum Su+i

ONTTL iSN
O0TPo
ND T SOM
START

INPUTN
Fnctorial e

REPEAT

Factornal Factoriel 3

UNTTL i4N
UTPUT Factaril
END

HavoCd erder AoaraS


al8las

cKEVwOR DS
C-fregramtming BoC
int imginoe
1ato
-Compex
6reak
I8Cong
19- r e g i s t e r vnCine
3case res t r i c t
4- c h a r

Const 2Shor t
6 Continue s 2 s t a t i c

4 dfa t z3 sizeef
ignc
2 4 s
26-s truct
(oeCse 26soieh

(len um 24. typedef


LRex t e n 28 unior
13FCoat 24: un signek
14: for 30 Vor
3lVeatile
(Sgoto
32wRile
donotwse

ACC a r e howerCase ony E we


t l i o - A é Cbrary.
them as ariables.

#incluce

You might also like