I don't believe that You have a knowledge professionally . . . if You want to understand "recursive programming" then start simple, and not with "Quicksort".
This program calculate the Fibonacci-Number - iterativ. Change it to a recursive program.
Code:
#include <stdio.h>
#include <stdlib.h>
void main(void)
{
unsigned long x,y;
int i, n;
x = y = i = 1;
//For Linux "system(clear)"
system("cls");
printf("\nBerechnet iterativ die Fibonaccizahl.");
printf("\nGeben Sie eine Zahl ein: ");
scanf("%d", &n);
printf("\n");
if (n == 0 || n == 1)
{
printf("\nDie Fibonaccizahl von %d ist: 1", n);
}
//For 3 show 1,2,3 -- Um bei 3 eine Anzeige von: 1 2 3 zu erreichen
printf("1 ");
if (n > 40)
{
//Input only to 40 - sonst Überlauf
printf("\nNur Eingaben bis 40!\n");
}
else while (i < n)
{
x = x + y; y = x - y; i++;
printf("%d ", x);
}
printf("\n\nDie Fibonaccizahl von %d ist: %lu\n\n", n, x);
}