problem with loop while writing an array

Here is my code:

const int analogInPin1 = A0;
const int analogInPin2 = A1;
const int analogInPin3 = A2;
const int analogOutPin = 9; 
int g = 0;
int m = 0;
int l = 0;
int G = 0; 
int M = 0;
int L = 0;
int array[7]={'*',G ,':', M ,':', L,';' };
void setup() {
  
  Serial.begin(115200);
}

void loop() {
  
  g = analogRead(analogInPin1);
   G = map(g, 0, 1023, 0, 5);
   analogWrite(analogOutPin, G);

  // print the results to the serial monitor:
//wSerial.print("gin = " );
 //w Serial.print(g);
 //w Serial.print("\t gout = ");
//w  Serial.println(G);
m = analogRead(analogInPin2);
  // map it to the range of the analog out:
  M = map(m, 0, 1023, 0, 5);
  // change the analog out value:
  analogWrite(analogOutPin, M);

  
l = analogRead(analogInPin3);
  // map it to the range of the analog out:
  L = map(l, 0, 1023, 0, 5);
  // change the analog out value:
  analogWrite(analogOutPin, L);
  array[1]=G;
  array[3]=M;
  array[5]=L;
 // int array[]={G,M,L};
 for (int i=0;i<7;i++)
 {
 Serial.print(array[i]);
 Serial.print('\t');
 if(i==6)
 Serial.println();
// Serial.println(array[3]);
// Serial.println(array[5]);
 }
  // print the results to the serial monitor:
//w  Serial.print("lin = " );
 //w Serial.print(l);
 //w Serial.print("\t lout = ");
 //w Serial.println(L);

  
  delay(2000);
}

What is this code supposed to do?

What are you trying to do?

What’s the problem you get?

Perhaps you're confusing the ASCII values of characters with their visual representations.

Who knows?

We both know. You can't mix different types like this in C/C++

int array[7]={'*',G ,':', M ,':', L,';' };

It compiles because it's legal, but it doesn't do what you expect because when you try to print '', for example, the print function sees it as an int (which is how you declared it) with the value 42 (which is the ASCII value of '').

And now we're here, those are the most terrible variable names. Single letter names and

const int analogInPin1 = A0\

Seriously!

g = analogRead(analogInPin1);
G = map(g, 0, 1023, 0, 5);
analogWrite(analogOutPin, G);

The PWM pin is never going to have much of a duty cycle. Its output to an RC filter will be 0 to 0.2 volts. Is that REALLY what you want?

Why, for this purpose, do g and G need to be global?

Why do you need 6 variables to hold data read from 3 pins, when you only write to one pin?