you input a number. and then you add 1 to it.
in the next loop you put a new value into num1 and add 1 to it again. so you are not caclulating the average.
you should add all numbers the user enters and divide the sum by 5.
Maybe you should first initialize num1 to 0, otherwise your num1+=1 could wind up being a weird number. To check, compile and run this slightly modified code.
I think you should just use another variable to increase (like num2+=1; instead of num1+=1;) and print that one at the end because all you are doing is reading num1 then adding a 1 to it
Edit: Also as whitenite1 said start i as 0 not 1, from 1 to 5 is only 4 numbers not 5
Yes I know for that was my answer.. he means the output must be 5 because after reading 5 numbers the counter must print 5 at the end and not 2, it printed 2 because the last number he input was 1 then num+=1 added 1 more to it.
Sorry about that. I forgot to notice that the variables were the the same for input and adding one to it. I'll try to be a little more observant in the future.