Ask User and Repeat key/s or key sequences

In a macro I want to use a prompt where a user can enter a number.
So that the macro repeats a key sequence say "@c" that many times.

I was thinking in the lines of...
//pseudocode set variable loopCounter to 0 times_to_Loop = prompt_for_User_Input() while(loopCounter < times_to_Loop){ key "@" key "c" loopCounter +=1 }
What I did in Keyboard Maestro

Any suggestions how to fix this ?

You can use the Repeat action or For Each action with a Number Range collection.

See also the Variable Repeat topic.

Wow. Thanks