Perl read/write File

This is a simple example how to write into a File with Perl, and then read from it.At first we write the numbers from 1 to 6 into the file, in the second we read from the file and print it on the screen, if you don’t want the “\n” at the end use the function chomp.

If you open a File for read use ‘<‘, for write ‘>’ and for append ‘>>’.

Result looks like:

you could check if a handler is open with this Perl handler function.

Fortran high precision example

This is an example about the high precision in Fortran, at first we see a normal Program:

our Result looks like this:


Now we use selected_real_kind(32) to get an higher precision data type:

Now we get this result:

looks much better than the first.

Fortran function example

This is an example in Fortran how to make a function:


C# input output example

This is a little Program written in C sharp with Mono, It reads a number from the Terminal multiplies with itself and then print back:

To compile run this:

And then start with Mono :

our result looks like this:

The same Programm in Java is here : Java input output example

Fortran input output example

This is a little Fortran example hot to read, calculate and write in terminal:

our output: