File tree Expand file tree Collapse file tree 1 file changed +16
-5
lines changed
LearningC/C_Language_Shorts Expand file tree Collapse file tree 1 file changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -261,7 +261,18 @@ When you want to create a function you put the prototype at the beginning of the
261261> return <return-value>;
262262> }; // note the semi-colon
263263> ```
264- >
264+ > example:
265+ > > in header
266+ > > ```
267+ > > float norm(float x, float y);
268+ > > ```
269+ > > in source
270+ > > ```
271+ > > float norm(float x, float y){
272+ > > return sqrt(x*x + y*y);
273+ > > }
274+ > >```
275+ >
265276
266277> [!TIP]
267278> **main** from the _main program_ is the **main function** \
@@ -288,17 +299,17 @@ Conditional statements are only executed under certain conditions\
288299### switch-case
289300```
290301 switch (<test >):
291- case (confition1 ):
302+ case (result A ):
292303 ...
293304 break;
294- case (confition2 ):
305+ case (result B ):
295306 ...
296307 break;
297- case (confition3 ):
308+ case (result C ):
298309 ...
299310 break;
300311 ...
301- default:
312+ default: // unexpected or obvious
302313 ...
303314 break;
304315```
You can’t perform that action at this time.
0 commit comments