Multithreading in C , Fİbonacci Program : I have newly started studying operating systems and       creating processes/threads on Linux system by using C programming language(thats what is expected us to use) but I have some problems on the code that I've been trying to write:
   
Here is my code written on an Ubuntu system:
        
        #include <pthread.h>
        #include <stdlib.h>
        #include <stdio.h>

        int total = 0;

       typedef struct
       {
	    int start;
	    int end;
	    int threadNo;
       }THREAD_PARAMETERS;

      void *work(void *parameters);
      int threadCount;

     int main(int argc, char* argv[])
     {
	
          printf("please give the number of terms you want to diplay..");
          scanf("%d", &threadCount);
	
	     pthread_t tid[threadCount];
	     pthread_attr_t attr[threadCount];
	
	     THREAD_PARAMETERS* lpParameter;
	
	      int n;
	 
        lpParameter = malloc(sizeof(THREAD_PARAMETERS)* threadCount);
         
        int  i=0;
	   `
        for(i=0; i<threadCount; i++)
	    {
		 lpParameter[i].start = 0;
		 lpParameter[i].end = 1;
		 lpParameter[i].threadNo = i + 1;

		 pthread_attr_init(&attr[i]);
		 pthread_create(&tid[i],&attr[i],work,&lpParameter[i]);	
	    }

	    for(i=0; i<threadCount; i++)
	    {
		pthread_join(tid[i],NULL);
        }
	    return 1;
        }

    

        void fibonacci(int a)
        {
         int  prev_term = 0, current_term = 1, next_term = 0;

         if(a==0){
         printf("%d\n",prev_term);
     
         }
         else if(a==1){
      
         next_term=current_term+prev_term;
         printf("%d\n",current_term);
         prev_term=current_term;
         current_term=next_term;

        void *work(void * parameters)
        {
	    THREAD_PARAMETERS* param = (THREAD_PARAMETERS*)parameters;
	    fibonacci(threadCount);
	    pthread_exit(0);
        }

The problem is the program counts with the threadCount variable but what the program prints is just threadCount times zeros.
And the main question is how can I make each of the threads write "only one term" of the Fibonacci series depending on the number of terms (which is at the same time the number of threads) entered by the user? Is there any other more logical way to implement this kind of program?

Thanks in advance.