Correct

连忙 vs 赶忙

/ liánmáng vs gǎnmáng /
Strokes

Definition

连忙 and 赶忙 both are Adverbs, which means [promptly; at once; hastily].

Example

连忙 and 赶忙 are used only in narration and not in imperative sentences or sentences relating to future events.
1
Jiàndào
见到
yǒurén
有人
lái
  
,
liánmáng
连忙
  
(
gǎnmáng
赶忙
  
)
guò
过去
zhāohu
招呼
  

He hurried to greet the guest as soon as he saw him.

2
Tīngjiàn
听见
jiàoshēng
叫声
  
,
liánmáng
连忙
  
(
gǎnmáng
赶忙
  
)
huíguò
回过
tóu
  

I turned back the moment I heard the call.

3
zhīdào
知道
自己
zuò
de
duì
不对
  
,
liánmáng
连忙
  
(
gǎnmáng
赶忙
  
)
xiàng
jiā
大家
dào
  

As soon as he knew it was his fault, he made an apology.

4
Xià
下课
hòu
  
,
liánmáng
连忙
  
(
gǎnmáng
赶忙
  
)
dào
shūguǎn
图书馆
jiè
cānkǎoshū
参考书
  

He went to the library to borrow the reference book as soon as the class was over.

5
Lǎorén
老人
shàngchē
上车
  
,
hǎo
好几
rén
liánmáng
连忙
  
(
gǎnmáng
赶忙
  
)
lai
起来
ràngzuò
让座
  

There were some people standing up to offer their seats to the old man as soon as he got on the bus.

连忙 sometimes sounds more literary, so in a more formal sentence, it is better to use 连忙.
6
Jiēdào
接到
shàng
上级
zhǐshì
指示
  
,
各个
dānwèi
单位
liánmáng
连忙
xíngdòng
行动
le
lai
起来
  

The work unit took action as soon as they got the order from their superior.