Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions style guide.md
Original file line number Diff line number Diff line change
@@ -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;
}