Consider the computable function Q:N×N→N given by Q(x,y)=x. By Kleene's second recursion theorem, there is some p such that the program with Gödel number p computes the function f(y)=Q(p,y)=p, i.e., a program which outputs p
for every input. This is exactly the program you're looking for: for any input, it outputs its own Gödel number.
Such a program is known as a quine, and they exist in any Turing-powerful model of computation.