diff --git a/c.md b/c.md index fc74a1b..2a4eae7 100644 --- a/c.md +++ b/c.md @@ -55,15 +55,15 @@ Switch is an alternative to if-else-if ladder. ```c switch(conditional-expression) { case value1: - // code - break; // optional + // code + break; // optional case value2: - // code - break; // optional + // code + break; // optional ... default: - // code to be executed when all the above cases are not matched; + // code to be executed when all the above cases are not matched; } ``` ### 3. For: diff --git a/cpp.md b/cpp.md index 0ea1416..aa8e79b 100644 --- a/cpp.md +++ b/cpp.md @@ -55,10 +55,10 @@ Switch is an alternative to If-Else-If ladder. ```c switch(conditional-expression){ case value1: - // code + // code break; // optional case value2: - // code + // code break; // optional ...... diff --git a/csharp.md b/csharp.md index 6e22b51..4734418 100644 --- a/csharp.md +++ b/csharp.md @@ -71,15 +71,15 @@ Switch is an alternative to If-Else-If ladder. ```c# switch(conditional-expression) { case value1: - // code + // code break; // optional case value2: - // code + // code break; // optional ... default: - // code to be executed when all the above cases are not matched; + // code to be executed when all the above cases are not matched; } ``` ### 3. For: diff --git a/go.md b/go.md index f045c81..90cd80c 100644 --- a/go.md +++ b/go.md @@ -104,10 +104,10 @@ Switch is an alternative to If-Else-If ladder. ```go switch conditional-expression { case value1: - // code + // code break; // optional case value2: - // code + // code break; // optional ... diff --git a/groovy.md b/groovy.md index 6ec031d..b0fd724 100644 --- a/groovy.md +++ b/groovy.md @@ -81,15 +81,15 @@ Switch is an alternative to If-Else-If ladder and to select one among many block ```java switch(conditional-expression) { case value1: - // code + // code break; // optional case value2: - // code + // code break; // optional ... default: - //code to be executed when all the above cases are not matched; + //code to be executed when all the above cases are not matched; } ``` diff --git a/java.md b/java.md index f457412..c59e5c1 100644 --- a/java.md +++ b/java.md @@ -44,14 +44,14 @@ Java is a very popular general-purpose programming language, it is class-based a ## Variables ```java -short x = 999; // -32768 to 32767 -int x = 99999; // -2147483648 to 2147483647 -long x = 99999999999L; // -9223372036854775808 to 9223372036854775807 +short x = 999; // -32768 to 32767 +int x = 99999; // -2147483648 to 2147483647 +long x = 99999999999L; // -9223372036854775808 to 9223372036854775807 float x = 1.2; double x = 99.99d; -byte x = 99; // -128 to 127 +byte x = 99; // -128 to 127 char x = 'A'; boolean x = true; ``` @@ -134,9 +134,9 @@ Class is the blueprint of an object, which is also referred as user-defined data ```java class Mobile { - public: // access specifier which specifies that accessibility of class members - string name; // string variable (attribute) - int price; // int variable (attribute) + public: // access specifier which specifies that accessibility of class members + string name; // string variable (attribute) + int price; // int variable (attribute) }; ``` ### How to create a Object: diff --git a/javascript.md b/javascript.md index 79e6b13..66ef860 100644 --- a/javascript.md +++ b/javascript.md @@ -132,12 +132,12 @@ const users = [ ``` ## Functions ```javascript -function greetings({ name = 'Foo' } = {}) { //Defaulting name to Foo +function greetings({ name = 'Foo' } = {}) { //Defaulting name to Foo console.log(`Hello ${name}!`); } -greet() // Hello Foo -greet({ name: 'Bar' }) // Hi Bar +greet() // Hello Foo +greet({ name: 'Bar' }) // Hi Bar ``` ## Loops ### 1. If: diff --git a/perl.md b/perl.md index 9646a53..3931bf8 100644 --- a/perl.md +++ b/perl.md @@ -40,8 +40,8 @@ There is no need to specify the type of the data in Perl as it is loosely typed In Perl, there is no need to explicitly declare variables to reserve memory space. When you assign a value to a variable, declaration happens automatically. ```perl -$var-name =value; #scalar-variable -@arr-name = (values); #Array-variables +$var-name =value; #scalar-variable +@arr-name = (values); #Array-variables %hashes = (key-value pairs); # Hash-variables ``` ## Loops diff --git a/php.md b/php.md index b988f04..39111da 100644 --- a/php.md +++ b/php.md @@ -82,15 +82,15 @@ Switch is used to execute one set of statement from multiple conditions. ```php switch(conditional-expression) { case value1: - // code if the above value is matched - break; // optional + // code if the above value is matched + break; // optional case value2: - // code if the above value is matched + // code if the above value is matched break; // optional ... default: - // code to be executed when all the above cases are not matched; + // code to be executed when all the above cases are not matched; } ``` @@ -106,7 +106,7 @@ for(Initialization; Condition; Increment/decrement){ ``` #### For-each: ```php -// you can use any of the below syntax + // you can use any of the below syntax foreach ($array as $element-value) { //code } diff --git a/typescript.md b/typescript.md index 6de924a..0463216 100644 --- a/typescript.md +++ b/typescript.md @@ -92,7 +92,7 @@ for(Initialization; Condition; Increment/decrement){ let arr = [1, 2, 3, 4, 5]; for (let ele of arr) { - // code +// code } for (let index in arr) { @@ -149,5 +149,5 @@ function Addition(a: any, b:any): any { return a + b; } Addition("Hello ","foo"); // outputs Hello foo -Addition(2,3); //outpus 5 -``` \ No newline at end of file +Addition(2,3); //outpus 5 +``` diff --git a/vb.md b/vb.md index 1c97f48..4941744 100644 --- a/vb.md +++ b/vb.md @@ -10,7 +10,7 @@ OneCompiler's VB.net online editor supports stdin and users can give inputs to p Public Module Program Public Sub Main(args() As string) Dim name as String = Console.ReadLine() ' Reading input from STDIN - Console.WriteLine("Hello " & name) ' Writing output to STDOUT + Console.WriteLine("Hello " & name) ' Writing output to STDOUT End Sub End Module ``` @@ -57,7 +57,7 @@ End If If(conditional-expression)Then 'code if the conditional-expression is true Else - 'code if the conditional-expression is false + 'code if the conditional-expression is false End If ``` @@ -65,7 +65,7 @@ End If ```vb If(conditional-expression)Then - 'code if the above conditional-expression is true + 'code if the above conditional-expression is true Else If(conditional-expression) Then 'code if the above conditional-expression is true Else @@ -77,7 +77,7 @@ End If ```vb If(conditional-expression)Then - 'code if the above conditional-expression is true + 'code if the above conditional-expression is true If(conditional-expression)Then 'code if the above conditional-expression is true End If