Help with simple variable

I am working with AIX ksh

I may have an output like one of the following (I am acuatlly using "ps eww <pid>" in a script and would like to assign one of the varable to a varable in my script):
example 1: a=1 b=2 c=3 d=4 e=5 f=6 g=8
or
example 2: e=5 d=3 b=1 a=2 c=4
or
example 3: 5=a 4=b 3=c

I need an easy command that will set a variable with what 3 is equal to:
example 1 I would like VAR=3 (since c was equal to 3)

example 2 I would like VAR=4 (since c was equal to 4)

example 3 I would like VAR= (since there was no c)

Any help would be greatly appreciated.

you can assign it to var as shown

VAR=`echo $c`
or
((VAR=$c))

Sorry I dont think I make my self clear. The following would be the output of a command. They are not yet variables.
example 1: a=1 b=2 c=3 d=4 e=5 f=6 g=8
or
example 2: e=5 d=3 b=1 a=2 c=4
or
example 3: 5=a 4=b 3=c

Although, there are many better and quicker ways. If you provided more details on the commands generating the output, there would be better solutions.

> VAR1=$(echo a=1 b=2 c=3 d=4 e=5 | tr " " "\n" | grep "^c=" | cut -d"=" -f2)
> echo $VAR1
3
>

> VAR1=$(echo 5=a 4=b 3=c 2=d 1=e | tr " " "\n" | grep "^c=" | cut -d"=" -f2)
> echo $VAR1

> 

oh ok got it...i think this will do

VAR=$(echo 5=a 4=b 3=c|awk -F"=" 'BEGIN{RS=" "}/^c/{print $2}')
VAR=$(echo a=1 b=2 c=3 d=4 e=5 |awk -F"=" 'BEGIN{RS=" "}/^c/{print $2}')