Difference between revisions of "BASH/C2/Conditional-Loops/Gujarati"

From Script | Spoken-Tutorial
Jump to: navigation, search
(Created page with "'''Title of script:''' '''Basic If loop in BASH ''' '''Author:''' Jyoti Solanki '''Keywords: video tutorial, for loop, while loop''' {| border=1 !Time !Narration |- | 00:0...")
 
Line 8: Line 8:
 
|-
 
|-
 
| 00:01
 
| 00:01
| નમસ્તે મિત્રો,  '''BASH''' માં '''loops''' પરનાં સ્પોકન ટ્યુટોરીયલમાં સ્વાગત છે. .
+
| નમસ્તે મિત્રો,  '''BASH''' માં '''loops''' પરનાં સ્પોકન ટ્યુટોરીયલમાં સ્વાગત છે.  
  
 
|-
 
|-
Line 174: Line 174:
 
|  02:57
 
|  02:57
 
|  ચાલો હું વિન્ડોના માપમાં ફેરબદલ કરું.  
 
|  ચાલો હું વિન્ડોના માપમાં ફેરબદલ કરું.  
 +
 
|-
 
|-
 
|  03:00
 
|  03:00
First we have value of '''i''' as '''1'''.
+
પ્રથમ '''i''' ની વેલ્યુ  '''1''' છે.
  
 
|-
 
|-
 
|  03:04  
 
|  03:04  
Then we check whether ''' 1 ''' is less than or equal to ''' 5.'''
+
પછી આપણે તપાસ કરીશું કે ''' 1 ''' એ  ''' 5.''' કરતા નાનું કે તે જેટલું છે કે.
  
 
|-
 
|-
 
|  03:10
 
|  03:10
| Since the condition is '''true,''' we calculate '''sum''' as ''' 0 + 1.'''
+
| કન્ડીશન ટ્રૂ હોવા પર  '''sum''' એ  ''' 0 + 1.''' મળશે.
  
 
|-
 
|-
 
|  03:16
 
|  03:16
| Now we have '''sum '''as '''1.'''
+
| હવે '''sum ''' ની વેલ્યુ '''1.''' છે.
  
 
|-
 
|-
 
|  03:20
 
|  03:20
| Then we print '''sum ''' i.e '''1.'''
+
| '''sum ''' ની  '''1.''' તરીકે પ્રિન્ટ થશે.
  
 
|-
 
|-
 
|  03:24  
 
|  03:24  
| Next, '''i''' is incremented by '''1''' and the new value of ''' i ''' is ''' 2.'''
+
|   આગળ, '''i''' ની વેલ્યુ  '''1''' થી વધશે અને ''' i ''' ને ''' 2.''' આ નવી વેલ્યુ મળશે.
  
 
|-
 
|-
 
|  03:31  
 
|  03:31  
| Then we check whether ''' 2 ''' is less than or equal to ''' 5.'''
+
| પછી આપણે તપાસીશું  કે ''' 2 ''' એ  ''' 5.''' કરતા નાનો કે તે જેટલો છે કે.
  
 
|-
 
|-
 
|  03:36  
 
|  03:36  
| The condition is '''true''' and now sum will be ''' 1 + 2 ''' i.e ''' 3.'''
+
| કન્ડીશન ટ્રૂ છે અને હવે આ વેલ્યુ  ''' 1 + 2 ''' એટલેકે ''' 3.''' છે.
  
 
|-
 
|-
 
| 03:44
 
| 03:44
|   '''i ''' is then incremented by '''1''' and then the new value of ''' i''' is ''' 3.'''
+
| '''i ''' ની વેલ્યુ  '''1''' થી વધશે અને  '''i''' ને ''' 3.''' આ નવી વેલ્યુ મળશે.
  
 
|-
 
|-
 
| 03:51
 
| 03:51
| And we get '''sum''' as ''' 6.'''
+
| અને આપણને '''sum''' એ  ''' 6.''' તરીકે મળશે.
  
 
|-
 
|-
 
| 03:55  
 
| 03:55  
The script will continue to add the next value of ''' i ''' to the previous value in ''' sum.'''
+
|  '''sum.''' ની પાછલી વેલ્યુમાં સ્ક્રીપ્ટ ''' i ''' ની આગળની વેલ્યુ ને ઉમેરવાનું ચાલુ રાખશે
  
 
|-
 
|-
 
| 04:02  
 
| 04:02  
| This will continue till '''<nowiki>i<=5</nowiki>''' is '''false.'''
+
| '''i<=5'''   આ  કન્ડીશન ફોલ્સ થતા શુધી ચાલુ રહેશે.
  
 
|-
 
|-
 
| 04:09  
 
| 04:09  
| On exiting the '''for loop,''' the final message is printed.
+
|   '''for loop,''' માંથી બહાર નીકળતા વખતે છેલ્લો મેસેજ પ્રિન્ટ થાય છે.
  
 
|-
 
|-
 
| 04:14   
 
| 04:14   
| Let us see another example of '''for loop'''using the second syntax.
+
| બીજો સિન્ટેક્સ વાપરેલો '''for loop''' નો અન્ય ઉદાહરણ જોઈએ.
  
 
|-
 
|-
 
| 04:20   
 
| 04:20   
| I have written the code in this file and named it as '''for-loop.sh'''
+
| મેં  '''for-loop.sh'''   ફાઈલમાં કોડ લખ્યો છે.
  
 
|-
 
|-
 
| 04:27   
 
| 04:27   
| This simple program will list the files in a directory.
+
| આ પ્રોગ્રામ ડિરેક્ટરીમાં ફાઈલ્સની યાદી દેખાડશે.
  
 
|-
 
|-
 
| 04:32  
 
| 04:32  
| This is the '''shebang line.'''
+
| આ  '''shebang line.''' છે
  
 
|-
 
|-
 
| 04:35  
 
| 04:35  
Then we have '''for loop'''.
+
| પછી આપની પાસે '''for loop''' છે.
  
 
|-
 
|-
 
| 04:37  
 
| 04:37  
| '''ls''' command lists the directory content.
+
| '''ls''' કમાંડ ડિરેક્ટરીમાંના વિષયવસ્તુની યાદી આપે છે.
  
 
|-
 
|-
 
| 04:41  
 
| 04:41  
| '''-1 (hyphen one)''' lists one file per line.
+
| '''-1 (hyphen one)''' એક લાઈન પર એક ફાઈલ  દેખાડશે.  
  
 
|-
 
|-
 
| 04:46  
 
| 04:46  
| This will list all the files present in your home directory.
+
| આ તમારા હોમ ડિરેક્ટરીમાં ઉપલબ્ધ બધી ફાઈલસ ની યાદી દેખાડશે.
  
 
|-
 
|-
 
|  04:51  
 
|  04:51  
| This is the end of '''for loop.'''
+
| આ  '''for loop.''' નો અંત છે.
  
 
|-
 
|-
 
| 04:53
 
| 04:53
Let us execute the script on the '''terminal''' by typing -
+
ટર્મિનલ પર સ્ક્રીપ્ટ એક્ઝીક્યુટ કરવા માટે ટાઈપ કરો.
  
 
|-
 
|-
Line 276: Line 277:
 
|-
 
|-
 
| 05:09
 
| 05:09
This will display all the files present in the '''Home''' directory.
+
આ હોમ ડિરેક્ટરીમાં ઉપલબ્ધ બધી ફાઈલસ દેખાડશે.
  
 
|-
 
|-
 
| 05:14   
 
| 05:14   
|   Now, we will learn about ''' while loop.'''
+
|   હવે આપણે ''' while loop.''' વિષે શીખશું.
  
 
|-
 
|-
 
| 05:18   
 
| 05:18   
| Let us understand the syntax first.
+
| ચાલો પહેલા સિન્ટેક્સ સમજીએ.
  
 
|-
 
|-
Line 290: Line 291:
 
|  '''while condition'''
 
|  '''while condition'''
 
'''statement 1, 2, 3'''
 
'''statement 1, 2, 3'''
End of '''while loop'''.
+
'''while loop''' નો અંત .
  
 
|-
 
|-
 
| 05:27
 
| 05:27
| This means that the '''while loop''' will execute as long as the condition is '''true.'''
+
| આનો અર્થ એ છે કે જ્યાં શુધી કન્ડીશન  ટ્રૂ થાય ત્યાં શુધી '''while loop''' એક્ઝીક્યુટ થશે.
  
 
|-
 
|-
 
|05:34
 
|05:34
|Let us see an example of '''while loop.'''
+
| ચાલો '''while loop.''' નો ઉદાહરણ જોઈએ.
  
 
|-
 
|-
 
|  05:37
 
|  05:37
| Here I have named it as '''while.sh'''
+
| અહી મેં  આને '''while.sh''' નામ આપ્યું છે
  
 
|-
 
|-
 
|  05:42
 
|  05:42
| In this program, we will calculate the sum of even numbers within a given range.
+
| આ પ્રોગ્રામમાં,આપણે શ્રેણીમાં આપેલ સમ સંખ્યાની ગણતરી મેળવશું.  
  
 
|-
 
|-
 
|05:49
 
|05:49
| Let us go through the code.
+
| ચાલો કોડ સમજીએ.
  
 
|-
 
|-
 
|05:52
 
|05:52
| Here, we accept a number from the user and store it in variable '''number'''.
+
| અહી યુઝર પાસેથી સંખ્યા સ્વીકારીને  '''number''' વેરીએબ્લમાં સંગ્રહીએ છીએ.
  
 
|-
 
|-
 
|05:59
 
|05:59
|   Next, we declare variables '''i''' and '''sum''' and initialize them to ''' 0 (zero).'''
+
| આગળ '''i''' અને  '''sum''' વેરીએબ્લને ડીકલેર કરીને તેને ઝીરોથી ઇનીશીલાઈઝ કરીએ.  
  
 
|-
 
|-
 
|06:06
 
|06:06
|Now this is the '''while condition.'''
+
|હવે આ  '''while condition.''' છે.
  
 
|-
 
|-
 
| 06:08
 
| 06:08
| Here we check whether '''i''' is '''less than or equal''' to value of '''number''' given by the user.
+
| અહી  '''i''' ની વેલ્યુ ''number''' ના વેલ્યુ જેટલી કે તે કરતા કમી છે કે તે તપાસીશું.
  
 
|-
 
|-
 
| 06:17   
 
| 06:17   
| Then we calculate the '''sum''' by adding value of '''i''' to value of '''sum'''.
+
|   પછી '''i''' ની વેલ્યુ ''sum''' ના વેલ્યુમાં મેળવીને '''sum'''. ની વ્લેયું લખીશું.  
  
 
|-
 
|-
 
|  06:24  
 
|  06:24  
Next, we increment the value of '''i''' with '''2'''.
+
આગળ '''i''' ની વેલ્યુને  '''2''' થી વધાવીશું.
  
 
|-
 
|-
 
|  06:28  
 
|  06:28  
| This will ensure that we only add the even numbers.
+
|.  આનથી આપણને ખાતરી મળશે કે આ ફક્ત સમ સંખ્યા જ ઉમેરે છે.
  
 
|-
 
|-
 
|  06:33  
 
|  06:33  
| And the while loop is repeated till the value of '''i''' exceeds the value of '''number.'''
+
| '''i''' ની વેલ્યુ  '''number.''' ની વેલ્યુ કરતા વધતા શુધી e ''''while loop '''' એક્ઝીક્યુટ થતું રહેશે.
 +
 
 
|-
 
|-
 
|  06:40  
 
|  06:40  
When we exit the '''while loop, '''we print the sum of all the even numbers within the given range.
+
|  '''while loop, ''' માંથી બહાર આવવા પર આપેલ શ્રેણીમાંના બધા સમ સંખ્યાનો સરવાળો પ્રિન્ટ થશે.  
  
 
|-
 
|-
 
|  06:47  
 
|  06:47  
| Let us execute the program.
+
| ચાલો પ્રોગ્રામ એક્ઝીક્યુટ કરીએ.
  
 
|-
 
|-
 
| 06:50  
 
| 06:50  
| Type on the '''terminal''':
+
|   '''terminal''': પર ટાઈપ કરો.
  
 
|-
 
|-
Line 365: Line 367:
 
|-
 
|-
 
|  07:00   
 
|  07:00   
| I will give '''15''' as my input.
+
| હું મારું ઇનપુટ '''15''' તરીકે આપીશ.
  
 
|-
 
|-
 
|  07:04  
 
|  07:04  
| The last line of the output is:
+
|   આઉટપુટ ની છેલ્લી લાઈન છે:
  
 
|-
 
|-
Line 375: Line 377:
 
| '''Sum of even numbers within the given range is 56.'''
 
| '''Sum of even numbers within the given range is 56.'''
  
|---[[User:PoojaMoolya|PoojaMoolya]] ([[User talk:PoojaMoolya|talk]]) 12:11, 8 December 2014 (IST)
+
|-
 
|  07:11  
 
|  07:11  
| Let me resize the window and explain the output.
+
| ચાલો હું વિન્ડોનું માપ બદલું અને તેનું આઉટપુટ સમજાવું.
  
 
|-
 
|-
 
| 07:14  
 
| 07:14  
| First we check whether '''i''' which is '''0,''' is less than or equal to the '''number''', which is '''15'''.
+
|   પ્રથમ '''i''' જે  '''0,''' છે તે '''15''' જેટલો કે તે કરતા કમી છે કે તે તપાસીશું.
  
 
|-
 
|-
 
|  07:24  
 
|  07:24  
The condition is '''true,''' hence '''sum''' will be '''0+0''' i.e '''0.'''
+
કન્ડીશન ટ્રૂ હોવા પર  '''sum''' એ  '''0+0''' એટલેકે '''0.''' હશે.
  
 
|-
 
|-
 
|  07:31
 
|  07:31
| Now '''i''' will be incremented by '''2''' and the '''new''' value of ''' i ''' is ''' 2.'''
+
|   હવે '''i''' ની વેલ્યુ  ''2''' થી વધશે અને  ''i''' ની નવી વેલ્યુ ''' 2.''' થશે.
  
 
|-
 
|-
 
|  07:37
 
|  07:37
Then we check if '''2''' is less than or equal to '''15'''.
+
હવે આપણે તપાસીશું કે  '''2''' '''15'''. જેટલું કે તે કરતા નાનું છે કે.
  
 
|-
 
|-
 
|  07:43  
 
|  07:43  
|   The condition again is '''true;''' so we add '''0+2.'''
+
|   ફરી કન્ડીશન એ ટ્રૂ છે ; તો '''0+2.''' આપણે ઉમેર્શું.
  
 
|-
 
|-
 
|  07:49  
 
|  07:49  
| Now '''sum ''' has the value '''2.'''
+
| '''sum ''' ની વેલ્યુ '''2.''' છે.
  
 
|-
 
|-
 
|  07:52
 
|  07:52
Again the value of '''i''' will be incremented by '''2'''.
+
ફરી  '''i''' ની વેલ્યુ ''2''' થી વધશે.
  
 
|-
 
|-
 
|  07:56
 
|  07:56
| So now value of '''i''' will be '''2+2''' i.e '''4.'''
+
| તો હવે '''i''' ની વેલ્યુ  ''2+2''' એટલેકે '''4.''' થશે.
  
 
|-
 
|-
 
|  08:03
 
|  08:03
| And the next value of ''' sum ''' will be '''4+2''' I.e '''6.'''
+
| અને ''' sum ''' ની આગળ ની વેલ્યુ '''4+2''' એટલેકે '''6.''' થશે.
  
 
|-
 
|-
 
|  08:09
 
|  08:09
|  In the same way, the script will continue to add '''2''' to the previous value of '''i, '''till it exceeds '''15'''.
+
|  In the same way, the script will continue to add '''2''' to the previous value of '''i, '''till it exceeds '''15'''. તેજ રીતે સ્ક્રીપ્ટ પાછલી
  
 
|-
 
|-

Revision as of 16:51, 14 January 2015

Title of script: Basic If loop in BASH Author: Jyoti Solanki Keywords: video tutorial, for loop, while loop

Time Narration
00:01 નમસ્તે મિત્રો, BASH માં loops પરનાં સ્પોકન ટ્યુટોરીયલમાં સ્વાગત છે.
00:07 આ ટ્યુટોરીયલમાં, આપણે શીખીશું,
00:09 * for loop (ફોર લૂપ)
00:11 * અમુક ઉદાહરણ સાથે while loop
00:15 આ ટ્યુટોરીયલ રીકોડ માટે હું વાપરી રહ્યી છું,
00:18 * ઉબુન્ટુ લીનક્સ 12.04 ઓપરેટીંગ સીસ્ટમ
00:22 * GNU BASH આવૃત્તિ 4.1.10
00:26 અભ્યાસ માટે ,GNU bash આવૃત્તિ 4 કે તેથી વધુ આગ્રહ કરીએ છીએ.
00:34 loops ના પરિચય સાથે શરૂઆત કરીએ.
00:37 સ્ટેટમેંટના ગ્રુપને વારેઘડીએ એક્ઝીક્યુટ કરવા માટે Loops વપરાય છે.
00:43 ચાલો સિન્ટેક્સ જોઈએ.
00:45 for expression 1, 2, 3
00:49 statement 1, 2, 3
00:51 અને આ for loop નો અંત છે.
00:55 for loop નો બીજો સિન્ટેક્સ છે:
00:58 for variable in sequence/range
01:03 statement 1, 2, 3
01:06 અને અહી for loop નો અંત છે.
01:09 ચાલો પ્રથમ સિન્ટેક્સ વાપરેલ ઉદાહરણ જોઈએ.


01:14 પ્રોગ્રામમાં આપણે પ્રથમ n સંખ્યાનો સરવાળો ગણતરી કરીશું.
01:20 નોંધ લો કે આપણી ફાઈલ નું નામ for.sh છે.
01:25 આ આપણી shebang line છે.
01:28 યુજર દ્વારા આપેલ વેલ્યુને number વેરીએબલમાં સંગ્રહિત કરવામાં આવશે.
01:34 અહી વેલ્યુ એ પૂર્ણાંક છે.
01:37 હવે આપણે sum વેરીએબલને ઝીરો તરીકે ઈનીશીલાઈઝ કરીશું.
01:42 અહી for loop. શરુ થાય છે.
01:45 પ્રથમ આપણે i to 1 ઈનીશીલાઈઝ કરીશું.
01:48 પછી આપણે તપાસીશું કે inumber. થી નાનો કે તેના જેટલો છે કે.
01:54 હવે અહી આપણે sum ને sum plus i તરીકે ગણતરી કરીશું.
02:00 અને પછી તેને પ્રિન્ટ કરીશું.
02:03 પછી i ની વેલ્યુ 1 થી વધાવીશું.
02:08 અને આપણે કન્ડીશન ત્યાર શુધી તપાસીશું જ્યાં શુધી આ કન્ડીશન ફોલ્સના થાય.
02:14 for loop, થી બહાર નીકળતા આ મેસેજ પ્રિન્ટ થશે.
02:19 ચાલો પ્રોગ્રામ એક્ઝીક્યુટ કરો અને શું થાય છે તે જોઈએ.
02:24 ટર્મિનલ પર ટાઈપ કરો - chmod +x for.sh
02:31 પછી ટાઈપ કરો : ./for.sh
02:36 હું 5 ને ઇનપુટ નંબર તરીકે દાખલ કરીશ.
02:40 i' ની વેલ્યુ માટે ગણતરી કરેલ sum દર્શાવ્યો છે.
02:46 આ પછી,આઉટપુટની છેલ્લીલાઈન દ્રશ્યમાન થાય છે:
02:50 Sum of first n numbers is 15
02:54 ચાલો હવે પ્રોગ્રામ કેવી રીતે કામ કરે છે તે જોઈએ.
02:57 ચાલો હું વિન્ડોના માપમાં ફેરબદલ કરું.
03:00 પ્રથમ i ની વેલ્યુ 1 છે.
03:04 પછી આપણે તપાસ કરીશું કે 1 5. કરતા નાનું કે તે જેટલું છે કે.
03:10 કન્ડીશન ટ્રૂ હોવા પર sum 0 + 1. મળશે.
03:16 હવે sum ની વેલ્યુ 1. છે.
03:20 sum ની 1. તરીકે પ્રિન્ટ થશે.
03:24 આગળ, i ની વેલ્યુ 1 થી વધશે અને i ને 2. આ નવી વેલ્યુ મળશે.
03:31 પછી આપણે તપાસીશું કે 2 5. કરતા નાનો કે તે જેટલો છે કે.
03:36 કન્ડીશન ટ્રૂ છે અને હવે આ વેલ્યુ 1 + 2 એટલેકે 3. છે.
03:44 i ની વેલ્યુ 1 થી વધશે અને i ને 3. આ નવી વેલ્યુ મળશે.
03:51 અને આપણને sum 6. તરીકે મળશે.
03:55 sum. ની પાછલી વેલ્યુમાં સ્ક્રીપ્ટ i ની આગળની વેલ્યુ ને ઉમેરવાનું ચાલુ રાખશે
04:02 i<=5 આ કન્ડીશન ફોલ્સ થતા શુધી ચાલુ રહેશે.
04:09 for loop, માંથી બહાર નીકળતા વખતે છેલ્લો મેસેજ પ્રિન્ટ થાય છે.
04:14 બીજો સિન્ટેક્સ વાપરેલો for loop નો અન્ય ઉદાહરણ જોઈએ.
04:20 મેં for-loop.sh ફાઈલમાં કોડ લખ્યો છે.
04:27 આ પ્રોગ્રામ ડિરેક્ટરીમાં ફાઈલ્સની યાદી દેખાડશે.
04:32 shebang line. છે
04:35 પછી આપની પાસે for loop છે.
04:37 ls કમાંડ ડિરેક્ટરીમાંના વિષયવસ્તુની યાદી આપે છે.
04:41 -1 (hyphen one) એક લાઈન પર એક ફાઈલ દેખાડશે.
04:46 આ તમારા હોમ ડિરેક્ટરીમાં ઉપલબ્ધ બધી ફાઈલસ ની યાદી દેખાડશે.
04:51 for loop. નો અંત છે.
04:53 ટર્મિનલ પર સ્ક્રીપ્ટ એક્ઝીક્યુટ કરવા માટે ટાઈપ કરો.
04:58 chmod +x for-loop.sh
05:04 ./for-loop.sh
05:09 આ હોમ ડિરેક્ટરીમાં ઉપલબ્ધ બધી ફાઈલસ દેખાડશે.
05:14 હવે આપણે while loop. વિષે શીખશું.
05:18 ચાલો પહેલા સિન્ટેક્સ સમજીએ.
05:21 while condition

statement 1, 2, 3

while loop નો અંત .
05:27 આનો અર્થ એ છે કે જ્યાં શુધી કન્ડીશન ટ્રૂ થાય ત્યાં શુધી while loop એક્ઝીક્યુટ થશે.
05:34 ચાલો while loop. નો ઉદાહરણ જોઈએ.
05:37 અહી મેં આને while.sh નામ આપ્યું છે
05:42 આ પ્રોગ્રામમાં,આપણે શ્રેણીમાં આપેલ સમ સંખ્યાની ગણતરી મેળવશું.
05:49 ચાલો કોડ સમજીએ.
05:52 અહી યુઝર પાસેથી સંખ્યા સ્વીકારીને number વેરીએબ્લમાં સંગ્રહીએ છીએ.
05:59 આગળ i અને sum વેરીએબ્લને ડીકલેર કરીને તેને ઝીરોથી ઇનીશીલાઈઝ કરીએ.
06:06 હવે આ while condition. છે.
06:08 અહી i' ની વેલ્યુ number ના વેલ્યુ જેટલી કે તે કરતા કમી છે કે તે તપાસીશું.
06:17 પછી i' ની વેલ્યુ sum ના વેલ્યુમાં મેળવીને sum. ની વ્લેયું લખીશું.
06:24 આગળ i ની વેલ્યુને 2 થી વધાવીશું.
06:28 . આનથી આપણને ખાતરી મળશે કે આ ફક્ત સમ સંખ્યા જ ઉમેરે છે.
06:33 i ની વેલ્યુ number. ની વેલ્યુ કરતા વધતા શુધી e 'while loop ' એક્ઝીક્યુટ થતું રહેશે.
06:40 while loop, માંથી બહાર આવવા પર આપેલ શ્રેણીમાંના બધા સમ સંખ્યાનો સરવાળો પ્રિન્ટ થશે.
06:47 ચાલો પ્રોગ્રામ એક્ઝીક્યુટ કરીએ.
06:50 terminal: પર ટાઈપ કરો.
06:52 chmod +x while.sh
06:56 ./while.sh
07:00 હું મારું ઇનપુટ 15 તરીકે આપીશ.
07:04 આઉટપુટ ની છેલ્લી લાઈન છે:
07:06 Sum of even numbers within the given range is 56.
07:11 ચાલો હું વિન્ડોનું માપ બદલું અને તેનું આઉટપુટ સમજાવું.
07:14 પ્રથમ i જે 0, છે તે 15 જેટલો કે તે કરતા કમી છે કે તે તપાસીશું.
07:24 કન્ડીશન ટ્રૂ હોવા પર sum0+0 એટલેકે 0. હશે.
07:31 હવે i ની વેલ્યુ 2 થી વધશે અને i ની નવી વેલ્યુ 2. થશે.
07:37 હવે આપણે તપાસીશું કે 215. જેટલું કે તે કરતા નાનું છે કે.
07:43 ફરી કન્ડીશન એ ટ્રૂ છે ; તો 0+2. આપણે ઉમેર્શું.
07:49 sum ની વેલ્યુ 2. છે.
07:52 ફરી i' ની વેલ્યુ 2 થી વધશે.
07:56 તો હવે i' ની વેલ્યુ 2+2 એટલેકે 4. થશે.
08:03 અને sum ની આગળ ની વેલ્યુ 4+2 એટલેકે 6. થશે.
08:09 In the same way, the script will continue to add 2 to the previous value of i, till it exceeds 15. તેજ રીતે સ્ક્રીપ્ટ પાછલી
08:18 And we get the total value in sum as 56.
08:24 This brings us to the end of this tutorial.
08:27 Let us summarize
08:28 In this tutorial we learnt two different syntax of for loop and we also learnt about the while loop.
08:37 As an assignment -
08:38 Find the sum of the first "n" prime numbers.
08:43 Watch the video available at the link shown below
08:46 It summarises the Spoken Tutorial project
08:50 If you do not have good bandwidth, you can download and watch it
08:54 The Spoken Tutorial Project Team
08:56 Conducts workshops using spoken tutorials
09:00 Gives certificates to those who pass an online test
09:04 For more details, please write to contact@spoken-tutorial.org
09:11 Spoken Tutorial Project is a part of the Talk to a Teacher project
09:14 It is supported by the National Mission on Education through ICT, MHRD, Government of India
09:22 More information on this Mission is available at the link shown below.
09:28 The script has been contributed by Fossee and spoken-tutorial team.
09:34 This is Ashwini Patil from IIT Bombay signning off.
09:38 Thank You for joining.

Contributors and Content Editors

Jyotisolanki, PoojaMoolya