C-and-Cpp/C3/Loops/Khasi
From Script | Spoken-Tutorial
Time | Narration |
00:01 | Ngi pdiang sngewbha ia phi sha ka Spoken tutorial halor ka phang Loops in C and C++. |
00:06 | Ha kane ka jinghikai ngin pule, |
00:09 | for loop,while loop bad |
00:12 | do…while loop. Ngin leh ia kane lyngba ka jingiarap jong ki katto katne ki nuksa . |
00:17 | Ngin peit ruh katto katne ki jingbakla bad ki solutions. |
00:21 | Ban record ia ka jinghikai, nga pyndonkam da |
00:24 | Ubuntu Operating System version 11.04, |
00:28 | gcc and g++ Compiler version 4.6.1 on Ubuntu. |
00:34 | To ngin sdang da ka jinglamphrang halor ka loops. |
00:38 | Loops ki execute ia ki group of instructions bunsien. |
00:44 | Ka shong ha ka jingdonkam bad la phiah ha ki lai bynta: |
00:48 | while loop do…..while loop bad |
00:51 | for loop To ngin sdang da ka while loop shuwa. |
00:56 | Ka while loop ka tests ia ka condition kaba na sdang. |
01:00 | Ka structure ka long: while ( condition ) |
01:03 | hapoh ki statement block. |
01:07 | Mynta leit sha ka do….while loop . |
01:09 | Ka do..while loop kan executed at least once shuwa ba ka condition kan validated. |
01:15 | ka structure ka long: |
01:17 | do (within the brackets) statement block, |
01:20 | Hadien ki bracket ka while ( condition ). |
01:23 | Phin iohi ba ia ka condition la check ha kaba khatduh. |
01:27 | Mynta, to ngin peit lyngba ki nuksa jong while loop bad do...while loop . |
01:32 | Nga lah dep type ia ka code halor ka editor. |
01:35 | To ngan plie ia ka. |
01:37 | Kynmaw ba ka kyrteng ka phail jongngi ka long while.c.. |
01:41 | Mynta ngin sa pule kumno ban add ia u wei na ki 10 number da kaba pyndonkam ka while' loop. |
01:47 | To ngan batai ia ka code mynta. |
01:49 | Kane ka dei ka header file. Jongngi. |
01:51 | Hapoh ka main() function ngi lah declare ar tylli ki integer variables x bad y bad bas dang da u 0. |
01:59 | Kane ka dei ka while loop. Jong ngi. |
02:02 | Ka condition jong ka while loop is x is less than or equal to 10. |
02:06 | Hangne ka value jong u x la add sha ka value jong u y. |
02:10 | Ka value ba ioh hadien ba lah add yn buh ha u y. |
02:15 | Nangta ngi print ia ka value jong u y. |
02:18 | Hangne u x la incremented. |
02:20 | Kaba mut u variable x un kiew da I wei. |
02:25 | Bad kane ka dei ka return statement jong ngi. |
02:27 | Mynta , to ngin execute ia ka prokram. |
02:30 | Sngewbha plie ia ka terminal window da kaba nion ia u Ctrl, Alt bad T keys ha kajuh ka por na ka keyboard jong phi. |
02:39 | Type gcc space while dot c space hyphen o space while |
02:45 | Nion Enter. |
02:47 | Type ./while (dot slash while). Nion Enter. |
02:52 | Ka output yn sa pyni. |
02:54 | Mynta to ngin peit ia ka jingtreikam ka while loop. |
02:57 | To ngan resize ia ka window. |
03:00 | Hangne, u value ba nyngkong jong u x and y ka long 0. |
03:04 | Kane kadei ka while condition jong ngi. |
03:06 | Hangne ngi check la u x u duna ne iaryngkat bad u 10 kaba mut ba u value jong u x kanlong naduh u 0 haduh 10. |
03:15 | Nangta ngi add y plus x (i.e) 0 plus 0, ngi ioh 0.
|
03:22 | Ngi print ia ka value jong u y, hangne ngi ioh 0. |
03:27 | Nangta ia u x la increment kaba mut ba mynta u value jong u x un long 1. |
03:33 | Nangta ngin check biang ia ka condition, 1 u duna ne iaryngkat bad u 10. Lada ka condition ka long true te ngin hap add ia ki values. |
03:44 | y (i.e ) 0 plus x kaba mut 1. 0 plus 1 long 1. |
03:50 | Ngi print ia u value kum 1. |
03:53 | Sa shisien u x la increment. |
03:55 | Mynta ka value jong u x ka long 2. |
03:59 | Ngin check biang ia ka condition. |
04:01 | U 2 u duna ne iaryngkat bad u 10, lada ka condition ka long true nangta ngin add ia ki values, (i.e ) 1 plus 2 ka ban mih 3. |
04:11 | Ngi print ia u value kum 3. |
04:13 | Kumne, kan iaid haduh jong u x un duna ne iaryngkat ia u 10 (x<=10). |
04:20 | Mynta, ngin peit ia ka juh ka prokram da kaba pyndonkam ka do….while loop .
|
04:24 | Kane ka long ka prokram jong ngi. |
04:26 | Kynmaw ba ka kyrteng jong ka phail jong ngi ka long do hyphen while dot c . |
04:31 | Ia kane ka bynta lah dep batai ha ka prokram ba hashwa. |
04:35 | Te, to ngin iaid noh sha ka do...while loop . |
04:38 | Hangne, ka body jong ka loop la execute bad ia ka condition la check. |
04:44 | Ka value jong u x la add sha ka value jong u y bad ka value ba ioh hadien ba la add la buh ha u y. |
04:52 | Ka logic ka long kumjuh kum ha ka while prokram. |
04:55 | Mynta to ngin execute ia ka prokram. |
04:58 | Phai biang sha ka terminal jong ngi. |
05:00 | Type gcc space do hyphen while dot c space hyphen o space do . Press Enter . |
05:08 | Type dot slash do (./do). Nion Enter . |
05:12 | Ngin iohi ia ka output ba ka iasyriem ia ka while program jong ngi. |
05:16 | Mynta, to ngin peit ia ka rukom treikam ka do...while loop . |
05:20 | To ngan resize ia ka window. |
05:22 | Hangne ka value jong u x bad y ka long 0. |
05:25 | Ngin add ia kito ki value. Nangta ngin ioh 0. |
05:29 | Mynta ka value jong u y kalong 0. |
05:31 | Ngi print ia ka value kum 0. |
05:33 | Nanga u x la increment da u 1 kaba mut mynta ka value jong u x ka long u 1, nangta ia ka condition lah ban check. |
05:42 | Phin iohi ba ka body jong ka loop la execute shwa. |
05:45 | La kumno kumno, ka lada ka condtion ka long false nangta ruh ngin ioh ia ka value 0. |
05:52 | Mynta, hangne ngin check la u 1 u duna ne iaryngkat bad u 10. |
05:56 | Ka condition kan dei. Bad ruh ngin add ia ki values. |
06:00 | Mynta u 0 plus 1. |
06:02 | Nangta ngin print ia ka value jong u y kum 1. |
06:05 | Sa shisien u x yn sa increment. |
06:08 | Mynta ka value jong u x ka long 2. |
06:11 | Nangta ngin check la u 2 u duna ne iaryngkat bad u 10. |
06:15 | Ngin phai biang nangne. |
06:17 | Nangta ngin add ia ki values. 1 plus 2 long 3. |
06:20 | Ngi print ia ka value jong u y kum 3. |
06:23 | Kumne, ki condition lah ban check haduh ba ka value jong u x kan duna ne iaryngkat bad u 10. |
06:30 | Bad kane ka dei ka return statement jong ngi. |
06:33 | Kynmaw ba hangne ka while condition kan kut da u semicolon. |
06:38 | Ha while loop ka condition kan ym kut da u semicolon. |
06:43 | Mynta to ngin peit kumno ban execute ia ki prokram ha ka C++. |
06:48 | Kane ka dei ka while prokram jong ngi ha ka C++. |
06:52 | Ka logic bad ka implementation ki long kumjuh ha ka C prokram jong ngi. |
06:56 | Don ki katto katne ki jing kylla kum ha ka headerfile kum iostream ha ka jaka jong ka stdio.h.
|
07:04 | Ngin pynrung ia ka 'using' statement hangne using namespace std bad hangne ngi lah pyndonkam ia ka cout function ha ka jaka jong ka printf function. |
07:16 | Ka structure jong ka while loop ka long kumjuh kum ha ka C prokram jong ngi. |
07:21 | To ngin execute ia ka prokram. |
07:23 | Phai biang sha ka terminal. |
07:25 | To ngan pyndam noh ia ka prompt. |
07:28 | Ban execute, type g++ space while dot cpp space hyphen o space while1 . Nion Enter . |
07:38 | Type dot slash while1 (./while1). Nion Enter . |
07:43 | Phin iohi ba ka output ka iasryiem ia ka while prokram jong ngi ha ka C. |
07:48 | Mynta to ngin peit ia ka do... while program ha ka C++. |
07:52 | Phai biang sha ka text editor. |
07:54 | Hangne ruh don ki jing kylla kiba ia sryiem kum ka header file , ka using statement bad ka cout function. |
08:03 | Kiwei pat kin ia sryiem. |
08:06 | To ngin execute ia ka prokram. |
08:08 | Phai biang sha ka terminal jong ngi. |
08:10 | Type g++ space do hyphen while dot cpp space hyphen o space do1 . Nion Enter . |
08:19 | Type dot slash do1 (./do1). Nion Enter . |
08:23 | Ngin iohi ia ka output ba ka ia sryiem ia ka do...while program jong ngi ha ka C. |
08:28 | Mynta ngin peit katto katne ki jing bakla bad ki solutions. |
08:32 | Phai biang sha ka text editor jong ngi. |
08:35 | Tharai, hangne ngan ym ai ka increment ha ka value jong u x. |
08:41 | Click Save. To ngin peit kaei kaban jia. |
08:44 | Phai biang sha ka terminal. To ngan pyndam ia ka prompt. |
08:47 | To ngan execute ia ka prokram. |
08:50 | Nion arsien ia u up-arrow key. |
08:54 | Sa shisien nion ia u up-arrow key. |
08:57 | Ka output kan pyni. |
08:59 | Ngin iohi shibun ki zero, kane ka long namar ba ka loop kam don ia ka terminating condition. |
09:07 | La tip ia ka kum ka infinite loop. |
09:10 | Infinite loop kan pynlong ia ka system ban nym respond. |
09:14 | Kan pynlong ia ka prokram ban shim ia baroh ki processors time tangba lah ban terminate ia ka. |
09:21 | Phai biang sha ka prokram jong ngi, to ngin pynbeit ia ki jing bakla. |
09:25 | Type x++ bad u semicolon. |
09:28 | Click Save. To ngin execute biang. |
09:31 | Phai biang sha ka terminal. |
09:33 | Nion u up-arrow key. |
09:38 | Hooid, ka lah long. |
09:40 | Da kane ngi lah poi sha kaba kut jong ka jinghikai. |
09:43 | To ngin phai biang sha ki slides jong ngi. |
09:45 | To ngin batai lyngkot. |
09:47 | Ha kane ka jinghikai ngi la pule, |
09:50 | while loop example. while(x is less than or equal to 10) |
09:54 | do….while loop . |
09:56 | ki nuksa. do statement block bad |
09:59 | while condition ha ka ba kut. |
10:01 | Kum ka assignment, |
10:03 | thoh ia ka prokram ban print ia kine, da kaba pyndonkam ia ka for loops. |
10:07 | 0 to 9. |
10:10 | Ka syntax jong ka for loop ka long |
10:12 | for (variable initialization; variable condition; and variable increment or decrement) |
10:20 | bad hangne kan long ka body jong ka loop. |
10:24 | Peit ia ka video ba lah ban ioh naka link ba la pyni harum. |
10:27 | Ka batai lyngkot ia ka spoken tutorial project.
|
10:30 | Lada phim don ka bor internet ba khlain, phi lah ban shu download sa peit pat hadien. |
10:33 | Ka team Spoken Tutorial Project:
|
10:35 | :* ka pynlong ki workshop da ba pyndonkam ia ki spoken tutorials |
10:38 | Yn ai syrnod ia kiba pass ia ka online test. |
10:42 | Na bynta ka jingtip ba kham bniah, sngewbha thoh sha ka
contact@spoken-tutorial.org |
10:47 | “Spoken Tutorial” Project ka dei ka bynta jong ka Talk to a Teacher. |
10:51 | La kyrshan ia kane ka project da ka National Mission on Education lyngba ICT, MHRD, jong ka sorkar India. |
10:58 | Shuh shuh ki jingtip halor kane ka mission phin ioh na kane ka link ba la ai harum : http://spoken-tutorial.org\NMEICT-Intro. |
11:02 | La pynkylla sha ka ktien khasi da i Godwin pyrbot bad nga i John Nongkynrih. |
11:08 | Khublei naka bynta ba iasnohlang
. |