Skip to content

Commit 4712b27

Browse files
authored
Updated conventions
1 parent a87534c commit 4712b27

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

CONVENTIONS.md

+21-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Coding Conventions
22
----
33
* For any language, your file must begin with comments in style given below (the comments must start at line 1 before any line of code) -
4-
```
4+
``` C
55
/* ===== ===== =====
66
77
Theory of Programming
@@ -60,3 +60,23 @@ if (a < 10 && b > 20) {
6060

6161
return 0;
6262
```
63+
* But you don't need to add a new line before the ```return``` statement if it is the only statement in the block. Example -
64+
``` C
65+
if (a < 10) {
66+
return 0;
67+
}
68+
69+
if (a < 5) {
70+
// comment
71+
return 0;
72+
}
73+
74+
a = a + b * c;
75+
76+
return 0;
77+
```
78+
* When you are using an end of line comment, please start with a space. Example -
79+
``` C
80+
// right
81+
//wrong
82+
```

0 commit comments

Comments
 (0)