diff --git a/style guide.md b/style guide.md new file mode 100644 index 0000000..ca9a81d --- /dev/null +++ b/style guide.md @@ -0,0 +1,43 @@ +Style of a code + +Styling your code is important as it solves a number of problems :- + +1 it makes the code readable +2 it makes the code easy to debug +3 it makes the code neat and clean +What you have to do? +=> styling a code means :- +1 intending it properly (the alignment should be proper) +2 give proper spacing b/w lines of code +3 add comments if you need it. +Here are some examples : - +if (x > 0) +{ + printf("x is positive\n"); +} +else if (x < 0) +{ + printf("x is negative\n"); +} +else +{ + printf("x is zero\n"); +} + + +Declare a switch as follows: + +switch (n) +{ + case -1: + printf("n is -1\n"); + break; + + case 1: + printf("n is 1\n"); + break; + + default: + printf("n is neither -1 nor 1\n"); + break; +} \ No newline at end of file