Dynamic Variable creation

I am trying to create some variables based on the input by the user, say if user entered 3 then 3 variables and if 5 then 5 variables.

I am using a for loop

 for (( i=1; i <= $num; i++ ))
do
x="num"
x+=$i
done

When i am using echo $x it will show num1 but now how to create variables named num1, num2 and so on.
I am not able to use:-

echo "$x"=0

Please advise.

What operating system and shell are you using?...

This is what shell array variables are designed for (if your shell supports them); otherwise you need something like eval (and eval is dangerous except under very limited circumstances).

I am using Linux(2.6.32-358.el6.x86_64) and Bash.

In both bash and ksh you can have arrays with integer subscripts (and with recent bash and 1993 or later ksh , you can also use non-numeric strings as subscripts). For example:

$ for((i = 1; i <= 5; i++))
do	num[$i]=$(($i * $i))
done
$ for((i = 1; i <= 5; i++))
do	printf 'num[%d]=%d\n' $i ${num[$i]}
done
num[1]=1
num[2]=4
num[3]=9
num[4]=16
num[5]=25
$