This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.*; | |
| class Main { | |
| public static void main(String[] args) { | |
| int a,b,c; | |
| Scanner sc = new Scanner(System.in); | |
| System.out.println("Enter Value"); | |
| a = sc.nextInt(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| using namespace std; | |
| void abc(); | |
| int main() { | |
| std::cout << "Hello World!\n"; | |
| abc(); | |
| return 0; | |
| } | |
| void abc(){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // JavaScript Function Four Ways | |
| // Function declaration | |
| function square(x){ | |
| return x * x; | |
| } | |
| // Function Expression | |
| const square = function(x){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var facebookProfile = { | |
| name : "Abhishek Raj RAvi", | |
| friends : 50, | |
| messages : ["Hello", "how are you", "i'm fine"], | |
| postMessage : function (message){ | |
| this.messages.push(message); | |
| return this.messages; | |
| }, | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var count = 0; | |
| function cc(card) { | |
| switch(card){ | |
| case 1: | |
| case 2: | |
| case 3: | |
| case 4: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var count = 0; | |
| function cc(card) { | |
| switch(card){ | |
| case 1: | |
| case 2: | |
| case 3: | |
| case 4: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function randomWholeNum() { | |
| // here random number is 0 to 100 | |
| return Math.floor(Math.random() * 100); | |
| } | |
| randomWholeNum(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function randomFromRange(myMin, myMax){ | |
| return Math.floor(Math.random() * (myMax - myMin + 1)) + myMin; | |
| } | |
| randomFromRange(12,152); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var array = [1, 12, 21, 2]; | |
| array.sort(function(a,b){ | |
| return b - a; | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var array = [1,2,3,4,5,6,7]; | |
| var newArray = []; | |
| newArray = array.reverse(); |