varying duty cycle program

The program below is to vary the duty cycle from ton=0 to ton=max.

int freq=9;
int i=0,j=0;
void setup() {
  pinMode(freq,OUTPUT);}     //gives PWM
void loop() {
  for(i=0;i<=36;i++)  {          //responsible to change duty cycle
    for(j=0;j<50;j++)    {       //keeps the set duty cycle for some time for visible change in PWM 
      i=0;
      digitalWrite(freq,HIGH);    
      delayMicroseconds(i);
      digitalWrite(freq,LOW);
      delayMicroseconds(36-i);}  }}

My observations:
The voltage at pin 9(named freq)with respect to ground is not changing.
Pin is functional checked for that also with other code.But what is expected is: PWM should vary continuously with ton=0us to ton=36us maintaining the frequency this isn’t happening.

 i=0;

why are you resetting i every time?

The voltage at pin 9(named freq)with respect to ground is not changing.

It never will. It will only ever be 0 or 5V.