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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

if(nishani=='+') z=x+y;<br />

else if(nishani=='-') z=x-y;<br />

else if(nishani=='*') z=x*y;<br />

else if(nishani=='/')<br />

if(y!=0) z=x/y; else b=0;<br />

if(b) printf("z=%d", z); else printf("0-ze gayofa akrZalulia");<br />

. . .<br />

II. amoxsnisas gamoviyenoT operatori switch. programis SesaZlo<br />

varianti<br />

#include<br />

main()<br />

{<br />

}<br />

char nishani; int x, y, z=73;<br />

scanf("%d%c%d", &x, &nishani, &y);<br />

switch (nishani)<br />

{<br />

}<br />

case '+': z = x + y; break;<br />

case '-': z = x - y; break;<br />

case '*': z = x * y; break;<br />

case '/': if(y!=0) z = x / y; else {<br />

default : ;<br />

break;<br />

printf("z=%d",z);<br />

m: return 0;<br />

mogvcems Sedegebs:<br />

1). 2+3<br />

z=5<br />

2). 2-3<br />

z=-1<br />

3). 3*5<br />

z=15<br />

}<br />

printf("0-ze gayofa akrZalulia!");<br />

goto m;<br />

4). 13/2<br />

z=6<br />

48<br />

5). 22/0<br />

0-ze gayofa akrZalulia!

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

Saved successfully!

Ooh no, something went wrong!