Posts

Showing posts with the label Swift

8 Codes to Find Versions

Image
The following is a collection of Codes used to Determine the Language or Compiler Version being used.    *The following Featured Codes were Created by  John Wells PHP Version <?php echo "PHP Version ".phpversion()."<br>"; ?> Click here to run this code Java Version public class Program {   public static void main(String[] args) {     System.out.format("Java Version = '%s'",         System.getProperty("java.version"));   } } Click here to see this code run Swift Version #if swift(>=4.2)  print("Running Swift 4.2 or later") #else #if swift(>=4.1)  print("Running Swift 4.1") #else #if swift(>=4.0)  print("Running Swift 4.0") #else  print("Running Swift earlier than 4.0") #endif #endif #endif Click here to run this code Ruby Version print "ruby #{ RUBY_VERSION }p#{ RUBY_...

Hello World in 10 Programming Languages

Image
Java Hello World public class Hello {       public static void main(String[] args){           System.out.println("Hello World!");} } Click here to see this code run HTML5 Hello World <!DOCTYPE html> <html>     <head>         <title>Page Title</title>     </head>     <body>         <h1>Hello World</h1>     </body> </html> Click here to run this code Python Hello World print("Hello World") Click here to see this code run C Hello World #include <stdio.h> int main() { printf("Hello World");      return 0;} Click here to see this code run C++ Hello World #include <iostream> using namespace std; int main() { cout << "Hello W...