create folders by using a loop

I want to create the following directory structure on SD card. I use arduino mega 2560
"0"
--"0"
----"0"
----"1"
----"2"
.
.
----"9"
--"1"
----"0"
----"1"
----"2"
.
.
----"9"
.
.
.
--"9"
----"0"
----"1"
----"2"
.
.
----"9"

If I write a for loop for this, say using the variable 'i' , then, the folder "i" is being created and not the numerical value I want. Is there any way I can resolve the problem?

This is the first time for me posting on arduino forum. pls let me know if I am not clear with my question.

Your question is not really clear, but I will tell you what I would do in pseudo code:

for Folder=0 to 9
  create folder "Folder Name" & Folder
  change to folder "Folder Name" & Folder

  for File = 0 to 9
    create file "File Name" & File
  next File

  change back parent folder ("..")
next Folder

I want my folder names to be digits.
example: "1" is the name of one of my folder.

for(i = 0; i <= 9; i++)
mkdir("i");

now, the problem I am facing is, every time folder named "i" is being created and folder "1", "2" etc.. are not being created. I think the same will be the problem in your pseudo code also.

 mkdir("i");

This creates a folder call i, it does not use the number i as you think it does. You need to create a string from the number i using something like sprintf().

Ok, let me be very clear with my question:
I want to store mobile numbers and the data of owners.
If say, my mobile number is 9848022338,
then I want to store the details of the owner of this number in file named 8.txt which is folder '3' which infact is in folder '3' in folder '2' in folder '2' in folder '0' in folder '8' in folder '4' in folder '8' in folder '9'.
that is, the directory structure should be as follows:
9
--8
----4
------8
--------0
----------2
------------2
--------------2
----------------3
------------------3
--------------------8.txt

pls explain how this task can be accomplished

Please publish the code you have so far so that we can be specific. For future reference you really need to explain fully what you are trying to achieve and what you have done so far when you ask for help.