The thread has been started and then the "Main ends" message has been written. When the t.Start() method is invoked the function func() is to be called, but it is completing the work of main function and only returning back to function, why is it so.

If i use static in the function the output is

Main Begins
Function
Main Ends

Why is this change happening. What is the order of execution of threads. Kinly help me.

The thread has been started and then the "Main ends" message has been written. When the t.Start() method is invoked the function func() is to be called, but it is completing the work of main function and only returning back to function, why is it so.

If i use static in the function the output is

Main Begins
Function
Main Ends

Why is this change happening. What is the order of execution of threads. Kinly help me.

When dealing with threads, consider the timing involved. The Start() is an invocation and not a direct call to the target thread function.
Therefore, (in your example), the Main has had no interupts to prevent it from completing before the thread function begins.
If you were to cause the main to sleep for a couple milliseconds after the Start, it would allow the thread function to startup before the Main completed (eg interupt).

The the static assignment allows the function to invoke quickly (timing).
Just because it is static does not mean it will always startup in the desired order, again timing.

Add a using System.Threading, and after the Start() call, use Thread.Sleep(2) and you should find the desired results even if the thread function is not static.
You may also wish to set the thread's IsBackground property to true before it is started. This will help the thread to perform better outside the main thread activity.

IsBackGround
Quote from Visual Studio 2008 on-line help
A thread is either a background thread or a foreground thread. Background threads are identical to foreground threads, except that background threads do not prevent a process from terminating. Once all foreground threads belonging to a process have terminated, the common language runtime ends the process. Any remaining background threads are stopped and do not complete.

My Info - a background thread is more forgiving than a foreground thread. The main application can not stop while any foreground threads are active. All background threads are automatically aborted when the main thread (the application) terminates.

I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...

Write a C program that should create a 10 element array of random integers (0 to 9). The program should total all of the numbers in the odd positions of the array and compare them with the total of the numbers in the even positions of the array and indicate ...