nic, your while loop will never end. Nothing in that loop changes the value of num. If it is greater than 0, then it will enter the loop and will loop infinitely, as it will stay greater than 0 for ever.
For that matter, your for loop will never be entered. You've put i+0 as your loop check condition. Since you initialise i to 0, the first time this is checked, i+0 will be 0 + 0 = 0, i.e. false. The loop will therefore immediately exit.
What are you trying to achieve with your while loop?
What are you trying to achieve with your for loop?