01.03.2013 Views

g. surgulaZe, g. janeliZe, i. xuciSvili

g. surgulaZe, g. janeliZe, i. xuciSvili

g. surgulaZe, g. janeliZe, i. xuciSvili

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

int a=3, b=4;<br />

float fartobi_1, fartobi_2, sxvaoba;<br />

fartobi_1=a*b/2;<br />

a=a*2;<br />

b=b+3;<br />

fartobi_2=0.5*a*b;<br />

sxvaoba=fartobi_2 – fartobi_1;<br />

}<br />

Tu Cven SevecdebiT aseTi saxiT Cawerili programis Sesrulebas,<br />

kompiuteri Caatarebs moqmedebebs, magram pasuxi CvenTvis ucnobi<br />

darCeba. saqme isaa, rom Cven programisgan pasuxi jer ar mogviTxovia,<br />

anu programaSi ar aris gaTvaliswinebuli pasuxis dabeWdva. Sedegis<br />

ekranze gamotanisaTvis programa unda Seicavdes beWdvis standartul<br />

funqcias printf(). funqcias printf()-s gaaCnia parametrebi: erTi an meti<br />

(parametrebis raodenoba fiqsirebuli ar aris).. pirveli<br />

(aucilebeli) parametri striqonuli tipisaa, mas uwodeben mmarTvel<br />

striqons (control string). Cvens SemTxvevaSi funqcia gamoiyureba<br />

Semdegnairad:<br />

printf(''shedegi=%f'', sxvaoba); aq brWyalebSi Casmuli fraza shedegi=<br />

iqneba gamotanili ekranze ucvlelad. Semdeg mmarTvel striqonSi<br />

dgas simboloebi %f, romlebic uCveneben, rom am adgilas iqneba<br />

gamotanili namdvili ricxvi. es namdvili ricxvi aris mmarTveli<br />

striqonis da mZimis Sendeg dasaxelebuli cvladis mniSvneloba<br />

(cvladi sxvaoba-s mniSvneloba). %f-s ewodeba formatis specifikatori.<br />

Cveni programa miiRebs saxes:<br />

{<br />

main( )<br />

int a=3, b=4; float fartobi_1, fartobi_2, sxvaoba;<br />

fartobi_1=a*b/2;<br />

a=a*2;<br />

22

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!