As mentioned, darn or dang are the closest approximations of damn , and crap also works, but other common alternatives include: shoot geez man!
what the heck!
(or hell , but that's closer to cursing)
ell.stackexchange.com/users/53/Ken Bellows
What you're looking for is a minced oath version of "damn it".
You have many options.
If you want to stay as close as possible to "damn it", just without the objectionable "damn" in there, you can use almost any single-syllable word that starts with D.
The most common are: • dang
it •
darn
it • dern
it If you just want an interjection you can use when things go awry, the possibilities multiply.
• shoot (instead of shit ) • shucks (instead of shit ; though note that "oh shucks" has a different meaning than "oh shit") • heck (instead of hell ) •
gosh (instead of god )
• what the hey (instead of " what the hell ")
•
oh my lord (instead of " oh my god
")
•
fricking (instead of fucking )
•
oh fudge (instead of " oh fuck
")
There are also some expressions that aren't really a minced variant of anything more explicit, but are used in the same sorts of situations.
The one that comes to mind is " oh dear ", but the stereotypical southern grandma could probably list a lot more.
ell.stackexchange.com/users/50/Martha
One could borrow expressions from fictional characters: "Oh, bother", from Winnie-the-Pooh "Rats", from Peanuts Spoken forcefully, they can express extreme exasperation, yet be fit for the ears of children.
"Drat" also works, though it is probably dated.
ell.stackexchange.com/users/39/barbara beeton
"Dang it" is the exact same meaning, except less intense.
As stated above you can say crap, but some might find that inappropriate (small children).
Furthurmore darn it is also useable.
Or for a similar meaning, you could also say "Oh, No!".
ell.stackexchange.com/users/67/Mark Robinson
Darn it is the less intense version of damn it
.There's also crap , which is the less intense version of the s word.
ell.stackexchange.com/users/25/Squazic
'Bugger' is used a lot in this corner of the world (Australia/NZ).
It is probably about the same 'politeness level' as damn it (and was even the running gag word in a nationally shown Toyota commercial ) -
though I expect this would be less so if people looked up the definition.
As the link shows, it is definitely used in the type of situations you describe.
ell.stackexchange.com/users/89/mcalex
I am looking for a short phrase that I can say when something bad happens. For example, when my mouse breaks or my computer is hanging.  I know the expression  damn it  but I need something more polite.
What can I say politely when something bad happens?
ell.stackexchange.com
<phrase-request><politeness>
ell.stackexchange.com/questions/419
ell.stackexchange.com/users/36/FolksLord
"Dang it" has the same meaning as "Damn it", but less intense. You could borrow expressions from fictional characters:   "Oh, bother", from  Winnie-the-Pooh, or   "Rats", from  Peanuts. You could also say "Oh, No!".  Other more polite substitutions include "What the hey", "shoot", "shucks", "heck", and "gosh". Dang it and darn it are viable alternatives. There are numerous alternatives, though some are inappropriate for children. You can also use expressions from fictional characters.
You can use expressions from fictional characters. There are numerous alternatives, though some are inappropriate for children. Dang or darn it could be used.