Please check
hello @Aparna
use long long or i and j. because i*i can exceed the range of int .
still not working
line no 17. it should be j=j+i;