Snippets

Shatrughn Gupta RunMyCode Online Test

Updated by Shatrughn Gupta

File hello-kotlin.kt Added

  • Ignore whitespace
  • Hide word diff
+/*
+  This program won't run properly without an input.
+  Try with: abc
+*/
+fun main(args: Array<String>) {
+    println("Hello World from Kotlin!")
+    println(readLine()!!)
+}

File hello-node.js Added

  • Ignore whitespace
  • Hide word diff
+console.log('Hello World from Nodejs!')
+console.log(require('fs').readFileSync(0).toString())

File hello-ruby.rb Added

  • Ignore whitespace
  • Hide word diff
+puts "Hello World from Ruby!"
+puts $stdin.read

File hello.c Added

  • Ignore whitespace
  • Hide word diff
+#include <stdio.h>
+#include <stdlib.h>
+
+int main(int argc, char* argv[])
+{
+    puts("Hello World from C!");
+    char *buffer = NULL;
+    long unsigned int len;
+    getline(&buffer, &len, stdin);
+    printf("%s", buffer);
+    free(buffer);
+    return 0;
+}

File hello.cpp Added

  • Ignore whitespace
  • Hide word diff
+#include <iostream>
+using namespace std;
+
+int main(int argc, char **argv)
+{
+    cout << "Hello World from C++!\n";
+    string mystr;
+    getline(cin, mystr);
+    cout << mystr << "\n";
+    return 0;
+}

File hello.go Added

  • Ignore whitespace
  • Hide word diff
+package main
+
+import "os"
+import "fmt"
+import "bufio"
+
+func main() {
+	fmt.Println("Hello World from Go!")
+	reader := bufio.NewReader(os.Stdin)
+	text, _ := reader.ReadString('\n')
+	fmt.Print(text)
+}

File hello.java Added

  • Ignore whitespace
  • Hide word diff
+/*
+  This program won't run properly without an input.
+  Try with: abc
+*/
+import java.util.Scanner;
+
+class HelloWorld {
+  public static void main(String[] args) {
+    System.out.println("Hello World from Java!");
+    Scanner scan = new Scanner(System.in);
+    System.out.println(scan.nextLine());
+  }
+}

File hello.php Added

  • Ignore whitespace
  • Hide word diff
+<?php
+    echo "Hello World from PHP!\n";
+    echo stream_get_contents(STDIN);
+?>

File hello.py Added

  • Ignore whitespace
  • Hide word diff
+import sys
+
+print('Hello World from Python!')
+for line in sys.stdin:
+    print line.rstrip()

File hello.py3 Added

  • Ignore whitespace
  • Hide word diff
+import sys
+
+print('Hello World from Python 3!')
+for line in sys.stdin:
+    print(line.rstrip())

File hello.scala Added

  • Ignore whitespace
  • Hide word diff
+/*
+  This program won't run properly without an input.
+  Try with: abc
+*/
+object HelloWorld {
+  def main(args: Array[String]): Unit = {
+    println("Hello World from Scala!")
+    println(scala.io.StdIn.readLine())
+  }
+}

File test.py Deleted

  • Ignore whitespace
  • Hide word diff
-print "Hi there from Python!"

File test.py3 Deleted

  • Ignore whitespace
  • Hide word diff
-print("Hi there from Python3!")

File test.txt Deleted

  • Ignore whitespace
  • Hide word diff
-console.log('Hello World from JavaScript!')

File test3.js Deleted

  • Ignore whitespace
  • Hide word diff
-console.log('Hello World from JavaScript!')
Updated by Shatrughn Gupta

File test.py Modified

  • Ignore whitespace
  • Hide word diff
-print("Hi there from Python3!")
+print "Hi there from Python!"

File test.py3 Added

  • Ignore whitespace
  • Hide word diff
+print("Hi there from Python3!")

File test.txt Added

  • Ignore whitespace
  • Hide word diff
+console.log('Hello World from JavaScript!')

File test2.txt Deleted

  • Ignore whitespace
  • Hide word diff
-console.log('Hello World from JavaScript!')
Updated by Shatrughn Gupta

File snippet.txt Deleted

  • Ignore whitespace
  • Hide word diff
-console.log('Hello World from JavaScript without filename!')

File test.py Added

  • Ignore whitespace
  • Hide word diff
+print("Hi there from Python3!")

File test.py3 Deleted

  • Ignore whitespace
  • Hide word diff
-print("Hello World from Python3!")
-
-print("Hello World from Python3!")

File test2.js Deleted

  • Ignore whitespace
  • Hide word diff
-console.log('Hello World from JavaScript!')

File test2.txt Added

  • Ignore whitespace
  • Hide word diff
+console.log('Hello World from JavaScript!')

File test3.js Added

  • Ignore whitespace
  • Hide word diff
+console.log('Hello World from JavaScript!')
Updated by Shatrughn Gupta

File test.py3 Modified

  • Ignore whitespace
  • Hide word diff
 print("Hello World from Python3!")
+
+print("Hello World from Python3!")
Updated by Shatrughn Gupta

File test.py3 Modified

  • Ignore whitespace
  • Hide word diff
-print("Hello World from Python3!")
+print("Hello World from Python3!")
  1. 1
  2. 2
HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.