Longest increasing subsequence problem: Dynamic programing

Given a set of integers in unsorted manner find the length of longest increasing subsequence. for example 10 23 3 45 56 24 80 25 98 longest increasing subsequence is 10 23 45 56 80 98 and its length is 6. then write an efficient c program to to find longest increasing subsequence and its length.

An un-optimize solution:
A[] = { 10 23 3 45 56 24 80 25 98 }