aRen написал:zaluusaa ta nar end yg c++ hel de bichigdeg ihevchlen hegeleg ugnuudiig i uueg zoiulaltiig ni mgl hl taviad ogooch plz ...
#include <stdio.h>
#include <conio.h>
#include-g ashiglaj tolgoi file-uudiig programdaa holboj ogdog. edgeer tolgoi file-uud n tusgailan beldej ogson standart functionuudiig agulj bdag. yamar tolgoi file-d yamar functionuud bgaag tuslamjnaas n harchij bolno. bas jisheenuudiig n ch harj bolno.
stdio.h tolgoi file n
STan
Dart
Input
Output gesen utgatai bogood orolt garaltiin undsen functionuud bairladag. uund : scanf, printf geh met.
conio.h tolgoi file n
CONsole
Input
Output gesen utgatai bogood orolt garaltiin zarim undsen functionuud, mon delgetstei ajillah functionuud bairladag.
Cpp programiin bas 1 chuhal yum bol main function.
void main ()
{...}
gesen baidaltaigaar bichih heregtei. ene function-s ehelj chinii program ajilladag. za tegeed program bichih gej bgaa hun huvisagchiin torol gedeg zuiliiin talaar sain medlegtei bh heregtei gej bodoj bna. C helend ihevchlen
int - buhel too (-32768 -s 32727)
char (- 128 -s 127)
float (-3.4*10^-38 -s 3.4*10^38)
gesen torluudiig ashigladag.
huvisagchdiig daraah baidaltai zarlana
int i , j , k l , m = 2513 ;
char o , p='1' ;
float f ;
utga olgoj ajillahdaa
i = 1 ;
k = m ;
o = 1 ;
o = 'A' ;
o = p ;
gah mayagtai bichne.
mon temdegt mortei ajillah heregtei bolson bol
char name [100] ;
gej zarlaj ogno.
utga olgoh doo
strcpy (name , "Wow") ;
gej bichne. String buyu temdegt mortei ajillah functionuudiig strings.h tolgoi file-s uzeerei.
nohtsol shalgah operator-g
if (<nohtsol>)
{ <block> }
if (<nohtsol>)
{<block>}
else
{<block>}
gesen baidaltai bichij bolno.
jishee n
if (a == 1)
printf ("ene too chin negiin too bna shdee") ;
else
printf ("ene too chin negiin too bish bnaa") ;
bas hamgiin chuhal yum bol davtaltiin operatoryyd yumaa. 3 yanz bna.
1. for (i = 0 ; i < 10 ; i ++) {<block>}
end i n davrtaltiin huvisagch, i < 10 gedeg n i-g 10-s baga bol davtana, i ++ i-g 1-r nemegduulne hegesen ug. davtagdah too n todorhoi.
jishee n:
----
s = 0 ;
for (i =1 ; i <= 10 ; i ++) s = s + i ;
-----
s n 1-10 hurtleh toonii niilberiig olno.
2. while (<nohtsol>) {<block>}
nohtsol bielj bval block-g davtana. nohtsloos hamaaran davtagdahgui bh bolomjtoi.
jishee n
------
s = 0 ;
i = 1 ;
while (i <= 10)
{
s = s + i ;
i ++ ;
}
------
s n 1-10 hurtleh toonii niilberiig olno.
3. do {<block>} while ( <nohtsol> ) ;
<block>-g <nohtsol> bielj bval dahin davtah. dor hayaj 1 davtagdana.
edgeer davtaltuudiin yalgaag sain oilgoj avah n anhlan surj bgaa humuust neleed chuhal gej bodoj bna.
za tegeed bicheed bval zondoo yum bna. zalhuu hursen bolgooo ... :D