Binary to decimal

Please tell my mistake in the logic as I am gettin run-time
error.

Change line 12 to for(int tes=1 ; tes<=t ; tes++){