Java/C2/Arithmetic-Operations/Gujarati
From Script | Spoken-Tutorial
| Time' | Narration
|
| 00:01 | 'જાવા માં એરિથમેટિક ઓપરેશન પરના આ ટ્યુટોરીયલમાં સ્વાગત છે. |
| 00:05 | આ ટ્યુટોરીયલ માં, તમે વિવિધ એરિથમેટિક ઓપરેશન વિશે શીખશો જેવા કે
Addition Subtraction Multiplication Division અને તેમને કેવી રીતે ઉપયોગમાં લેવું. |
| 00:16 | આ ટ્યુટોરીયલ માટે આપણે
Ubuntu 11.10, JDK 1.6 અને Eclipse 3.7 ઉપયોગ કરી રહ્યા છીએ. |
| 00:24 | આ ટ્યુટોરીયલ અનુસરવા માટે તમારી સિસ્ટમ પર એક્લીપ્સ સ્થાપિત હોવું જોઈએ. |
| 00:28 | અને તમને Eclipse માં કેવી રીતે ફાઈલ બનાવવી, સંગ્રહવી અને રન કરવી તે ખબર હોવી જોઈએ. |
| 00:32 | જો નહી તો સંબધિત ટ્યુટોરીયલ માટે દર્શાવેલ અમારી વેબસાઈટ જુઓ. |
| 00:42 | અહીં ઓપરેટરો અને તેઓ કરતા ગાણિતિક ઓપરેશનોની યાદી છે
|
| 00:54 | આપણે તે દરેકને વિગતવાર જોઈશું. |
| 01:05 | અહીં આપણી પાસે ઇક્લિપ્સ IDE અને બાકીના માટે કોડ જરૂરી માળખું છે. |
| 01:10 | આપણે Arithmetic Operations નામનો ક્લાસ બનાવ્યો છે અને main મેથડ ઉમેર્યી છે. |
| 01:17 | ચાલો અમુક વેરિયેબલ ઉમેરીએ. |
| 01:22 | int x = 5; |
| 01:26 | 'int y = 10;
int result
|
| 01:35 | x અને y ઓપરેન્ડ્સ હશે result ઓપરેશનનું આઉટપુટ સંગ્રહ કરશે. |
| 01:41 | ચાલો તેમને ઉમેરીએ અને આઉટપુટ પ્રિન્ટ કરીએ. Result= x+y; system. out. println ' કૌસમાં, result |
| 02:10 | Control S સાથે તેને સંગ્રહ કરો અને રન કરવા માટે control F11 ડબાઓ. |
| 02:17 | આપણે જોશું, સરવાળાનું આઉટપુટ સંગ્રહ કરવામાં આવે છે અને વેલ્યુ પ્રિન્ટ કરવામાં આવી છે. |
| 02:24 | હવે ચાલો વેલ્યુઝ બદલીએ. x=75,y = 15 |
| 02:37 | Save કરો. Run કરો. |
| 02:42 | આપણે જોશું કે આઉટપુટ તે અનુસાર બદલાયેલ છે. |
| 02:48 | હવે ચાલો નેગેટીવ વેલ્યુઝનો પ્રયાસ કરીએ. 'y = -25. |
| 02:57 | Save Run. |
| 03:02 | આપણે જોશું કે 75 પ્લસ માઈનસ 25 પ્રિન્ટ થયું છે. |
| 03:10 | હવે ચાલો બાદબાકી પ્રયાસ કરીએ. 'y = 5 અને x+y ને x-y થી બદલો. |
| 03:25 | Save કરો Run કરો. |
| 03:32 | આપણે જોશું કે 75-5 નું આઉટપુટ પ્રિન્ટ કરવામાં આવ્યું છે. |
| 03:38 | હવે ચાલો ગુણાકારનો પ્રયાસ કરીએ. minus ને asterisk સાથે બદલો. |
| 03:46 | Save અને Run કરો. |
| 03:52 | આપણે જોયું કે asterisk ના ઉપયોગ થી આપણે 75 ને 5 સાથે ગુણી શકીએ છીએ. |
| 03:58 | હવે ચાલો ભાગાકારનો પ્રયાસ કરીએ. asterisk રદ કરો અને સ્લેશ ટાઇપ કરો. |
| 04:07 | Save અને Run કરો. |
| 04:13 | આપણે જોઈ શકીએ છીએ કે આઉટપુટ ધારવા પ્રમાણેનું છે. |
| 04:18 | Now let us see what happens when the expected result is a decimal point number. |
| 04:24 | Change 5 to 10 |
| 04:28 | The result must be 7.5. |
| 04:30 | So let us change the result to a float. |
| 04:43 | Save it Run. |
| 04:50 | Note that although the expected result is 7.5, we get output as 7.0 |
| 04:57 | This is because both the operands involved in the division are integers. |
| 05:01 | Let us change y to a float. y=10f |
| 05:15 | Save Run. |
| 05:21 | Now we can see that the result is as expected.
|
| 05:24 | Keep in mind that when the expected result is a float, one of the operands must be a float to get the expected output. |
| 05:32 | Now let us see what happens when there is more than one operator.Remove all the operands |
| 05:48 | int result= 8+4-2. Save it ,run |
| 06:09 | As we can see, the output is as expected. |
| 06:12 | Now Change minus to a slash
|
| 06:19 | Now the output would be 6 if the addition is done before division.
|
| 06:25 | Or it would be 10 if division is done before addition.
|
| 06:30 | Let us Run and see the output.
|
| 06:38 | As we can see, the output is 10 and the division is done before addition. This is because the division operator has more precedence than the addition operator.
|
| 06:50 | In such situations, if we need to override the precedence, we use parentheses. |
| 07:04 | By adding parentheses, we instruct Java to do the addition before the division.
|
| 07:10 | Let us run the file now.
|
| 07:15 | As we can see, addition has been performed first and the output is 6 as expected.
|
| 07:22 | As a rule, keep in mind to use parentheses when the order of operations is not clear. |
| 07:36 | This brings us to the end of this tutorial. |
| 07:40 | we have learnt |
| 07:41 | How to perform basic mathematical operations in Java. |
| 07:44 | operator precedence, and, |
| 07:45 | How to override it. |
| 07:49 | As an assignment for this tutorial Find out what is meant by the modulo operator and what it does. |
| 07:57 | To know more about the Spoken Tutorial project, watch the video available at the following link, |
| 08:02 | It summarizes the project. |
| 08:05 | If you do not have good bandwidth you can download and watch it |
| 08:10 | The Spoken Tutorial Team. |
| 08:12 | Conducts workshops using spoken tutorials |
| 08:14 | Gives certificates to those who pass an online test. |
| 08:18 | For more details, please write to spoken HYPHEN tutorial DOT org. |
| 08:24 | The Spoken Tutorial Project is a part of the Talk to a Teacher project . |
| 08:29 | It is supported by the National Mission on Education through ICT, MHRD, Government of India. |
| 08:35 | More information on this Mission is available at the following link spoken HYPHEN tutorial DOT org SLASH NMEICT HYPHEN Intro |
| 08:39 | This tutorial has been contributed by TalentSprint. Thanks for joining. |