There are lots of ways to great in Vietnamese language and it depending who you are talking to. For example :
You are 30 years old :
1 - 7 = Chào con, Chào cháu
8 - 29 = Chào em
30 = Chào bạn or Xin chào
30 - 49 = Chào chị ( Female), Chào anh (Male)
50- 65 = Chào cô ( Female), chào chú (Male) ( but sometime Vietnamese people will call " Chào chị" or " chào anh " just for please the others' sense)
65 - .......: Chào bà ( Female), Chào ông ( Male), or Chào cụ ( Female and Male)
Quick notes:
If you can't know exactly how old is she/he , you can use " Xin chào" ( in short) or " Chào + name" .( like the way you say " Hello , hi" or "hello + name" in English greeting).
"Chào bạn" will be impolite with whoever are older than you ^)^ . They can accept it because you are a foreigner but if you want to be more friendly at the first time seeing you avoid to use it ^)^ . You can use " Xin chào" as the best choice in that case
In fact, if you want your greeting make a sense , you can use "Em + Chào chị/ anh" and " Cháu / con + chào cô/chú/ cụ". "
One more thing, you shouldn't use " Xin + chào em/ chị/ anh/ cụ....." It's right but Vietnamese aren't use it....^)^