g. surgulaZe, g. janeliZe, i. xuciSvili
g. surgulaZe, g. janeliZe, i. xuciSvili g. surgulaZe, g. janeliZe, i. xuciSvili
programis muSaobis Sedegia: 2 4 8 e.i. tipi short int ikavebs mexsierebaSi 2 baits, x+y gamosaxulebis tipia long da am tips gamoeyofa 4 baiti. saintereso Sedegi mogvca operatorma printf("\n%d", sizeof(x+z)); x+z gamosaxulebaSi mocemulia 2 gansxvavebuli tipis cvladis jami: x – long tipisaa, z – double tipis. programam daadgina mocemuli jamis tipi, rogorc double da dabeWda 8 (baiti). 1.5.1. tipebis gardaqmna ariTmetikul gamosaxulebaSi C-Si daSvebulia ariTmetikul gamosaxulebaSi sxvadasxva tipis cvladebis gamoyeneba. aseTi gamosaxulebis gamoTvlis dros sruldeba tipebis avtomaturi gardaqmna. moviyvanoT ramdenime wesi, romelic gamoiyeneba tipebis avtomaturi gardaqmnis (amboben – tipebis dayvanis) dros: 1. float tipis operandebi daiyvaneba double tipze; 2. Tu erTi operandi long double tipisaa, meorec daiyvaneba amave tipze; 3. Tu erTi operandis tipia double, meorec gardaiqmneba double tipad; 4. char da short tipis operandebi daiyvaneba int tipze; 5. yoveli unsigned char da unsigned short operandi daiyvaneba unsigned int tipze; 6. Tu erTi operandi unsigned long tipisaa, meore operandis tipic gaxdeba unsigned long; 7. Tu erTi operandis tipia long, meore operandis tipic gaxdeba long; 8. Tu erTi operandis tipia unsigned int, meore operandis tipic gaxdeba unsigned int. 33
wesebi gviCvenebs, rom gamosaxulebis gamoTvlisas operandebi daiyvaneba im operandis tipze, romelsac udidesi zoma aqvs. magaliTad, mocemulia aRwera: double f, s; unsigned char ch; unsigned long k; int i; unda gamoviTvaloT s=f*(i+ch/k); tipebis gardaqmnis Tanmimdevroba Semdegia: operandi ch daiyvaneba unsigned int tipze (wesi 5), Semdeg igive ch daiyvaneba unsigned long tipze, radganac ch/k operaciaSi k - unsigned long tipisaa (wesi 6), Semdeg i daiyvaneba unsigned long tipze, da mrgval frCxilebSi mocemuli gamosaxulebis Sedegi iqneba unsigned long tipis. es Sedegi daiyvaneba double tipze (wesi 3), da mTeli gamosaxulebis tipi iqneba double. 1.5.2. tipebis gardaqmna miniWebisas miniWebis dros Tu miniWebis operaciis marjvena da marcxena operandebis tipebi gansxvavdeba, moqmedebs tipebis gardaqmnis martivi wesi: miniWebis operaciis marjvena mxares mdebare mniSvnelobis tipi daiyvaneba im cvladis tipze, romelsac eniWeba mniSvneloba. magaliTad, programa #include main() { short x=19; char y=125; float z; z=x+y; printf("%d %d %d",sizeof(x), sizeof(y), sizeof(x+y)); printf("\n%d %f", sizeof(z), z); return 0; } daabrunebs Sedegs: 2 1 4 4 144.000000 pasuxidan Cans, rom x+y-is mniSvneloba gardaiqmna z-is tipze. 34
- Page 1 and 2: g. surgulaZe, g. janeliZe, i. xuciS
- Page 3 and 4: uak 681.3.06 saxelmZRvaneloSi warmo
- Page 5 and 6: 2.3. mimTiTeblebi. mimTiTeblis gamo
- Page 7 and 8: I Tavi. martivi monacemTa tipebi. e
- Page 9 and 10: funqciebze). obieqturi modulis damu
- Page 11 and 12: stilSic da orive stilSi erTdroulad.
- Page 13 and 14: 1.2.4. komentari C-Si C-ze daweril
- Page 15 and 16: signed short int aRwers niSnian mok
- Page 17 and 18: ezervirebuli sityva void ANSI C sta
- Page 19 and 20: operaciis marjvena mxares. magaliTa
- Page 21 and 22: a=b++; Sesrulebis Sedegad a-s mniSv
- Page 23 and 24: int a=3, b=4; float fartobi_1, fart
- Page 25 and 26: } a=a*2; b=b+3; fartobi_2=0.5*a*b;
- Page 27 and 28: urSi misi tipi ar mieTiTeba, maSin
- Page 29 and 30: == - udris; != - ar udris. Sedarebi
- Page 31 and 32: daabrunebs 0-s. rogorc vxedavT, Caw
- Page 33: mzimiT gamoiyofa gamosaxulebebi, xo
- Page 37 and 38: 1.6. failis CarTva #include saTao f
- Page 39 and 40: 1.7. ganStoebis operatorebi if, if-
- Page 41 and 42: 40 else printf("udidesi= %f", b); u
- Page 43 and 44: a++; aq mocemulia if operatoris Sem
- Page 45 and 46: { d=b; b=c; c=d; } if(a>b) { d=a; a
- Page 47 and 48: { } case 1: z=3*x-y; break; case 2:
- Page 49 and 50: if(nishani=='+') z=x+y; else if(nis
- Page 51 and 52: marTvis gadacemas WdiT moniSnul ope
- Page 53 and 54: ciklis tani ar Sesruldeba, marTva g
- Page 55 and 56: #include /* evklides algoriTmi */ m
- Page 57 and 58: programis muSaobis Sedegebi: 1). Se
- Page 59 and 60: Sesruleba (1/0)? "); romlis Semdega
- Page 61 and 62: 3. Tu gamosaxuleba_2-s mniSvneloba
- Page 63 and 64: for( ; ; ) printf("usasrulo cikli\n
- Page 65 and 66: if(b) printf("martivia"); else prin
- Page 67 and 68: 1.11. simboluri Setana-gamotana C-S
- Page 69 and 70: char ch; return 0; } printf("Seitan
- Page 71 and 72: moviyvanoT programa, romelic klavia
- Page 73 and 74: #include #include main() { } char c
- Page 75 and 76: main() { } { char p; while ((p = ge
- Page 77 and 78: II Tavi. monacemTa struqturirebuli
- Page 79 and 80: magaliTad, Tu mocemulia aRwera char
- Page 81 and 82: ganvixiloT masivis gamoyenebis ramd
- Page 83 and 84: max-min=356.65 4. dabeWdeT n-elemen
wesebi gviCvenebs, rom gamosaxulebis gamoTvlisas operandebi<br />
daiyvaneba im operandis tipze, romelsac udidesi zoma aqvs.<br />
magaliTad, mocemulia aRwera:<br />
double f, s; unsigned char ch; unsigned long k; int i;<br />
unda gamoviTvaloT<br />
s=f*(i+ch/k);<br />
tipebis gardaqmnis Tanmimdevroba Semdegia: operandi ch daiyvaneba<br />
unsigned int tipze (wesi 5), Semdeg igive ch daiyvaneba unsigned long tipze,<br />
radganac ch/k operaciaSi k - unsigned long tipisaa (wesi 6), Semdeg i<br />
daiyvaneba unsigned long tipze, da mrgval frCxilebSi mocemuli<br />
gamosaxulebis Sedegi iqneba unsigned long tipis. es Sedegi daiyvaneba<br />
double tipze (wesi 3), da mTeli gamosaxulebis tipi iqneba double.<br />
1.5.2. tipebis gardaqmna miniWebisas<br />
miniWebis dros Tu miniWebis operaciis marjvena da marcxena<br />
operandebis tipebi gansxvavdeba, moqmedebs tipebis gardaqmnis martivi<br />
wesi: miniWebis operaciis marjvena mxares mdebare mniSvnelobis tipi<br />
daiyvaneba im cvladis tipze, romelsac eniWeba mniSvneloba.<br />
magaliTad, programa<br />
#include<br />
main()<br />
{<br />
short x=19; char y=125; float z;<br />
z=x+y;<br />
printf("%d %d %d",sizeof(x), sizeof(y), sizeof(x+y));<br />
printf("\n%d %f", sizeof(z), z);<br />
return 0;<br />
}<br />
daabrunebs Sedegs: 2 1 4<br />
4 144.000000<br />
pasuxidan Cans, rom x+y-is mniSvneloba gardaiqmna z-is tipze.<br />
34