It looks like you've created a very nice project. These are just some general suggestions that you might consider either for this project or your future endeavors:
Use Tools > Auto Format on your code regularly, especially before posting to the forum. The automatic indentation will make your code easier to read and make it easier to spot any bugs.
Don't use unnecessary blank lines. It's fine to add some to break code into sections but you have random blank lines that make for more scrolling and harder to read code.
Avoid using goto. It is very rarely useful and can cause your code to be harder to follow. Your code:
  while(alm == 0){
Â
  alarm();
  reset();
  if(alm == 1){
   goto bailout;
  }
 }
 }
 bailout:
would work just the same if you wrote it as:
 while(alm == 0){
Â
  alarm();
  reset();
 }
 }
because once alm==1 the while loop will exit. However, it is sometimes useful to be able to exit a while loop this could be done without goto like this:
  while(alm == 0){
Â
  alarm();
  reset();
  if(alm == 1){
   break;
  }
 }
 }
See https://www.arduino.cc/en/Reference/Break for more information.
Use descriptive variable names. You may be able to remember what d, a, and b are now but if you come back to your program months later you'll have forgotten and need to look through the code to see what they are. This becomes much more important as you write more complex programs.
Don't use "magic numbers" an example of a magic number in your code is the 1 and 0 values of alarm. They are just arbitrary numbers. Much better would be to use a descriptive variable name for alm, such as alarmActive and set it to true or false.
alarmActive = false;
is much easier to understand than:
alm = 1;
Use const on variables that should never change. This can be very useful for avoiding bugs. For example, imagine if you accidentally wrote something like:
ldr = analogRead(ldr);
but you really meant to write:
ldrValue = analogRead(ldr);
with your current code you will have a strange bug that's hard to find. If you make ldr const then the first code would cause your program to not compile and you'll have a helpful error message that tells you exactly what the problem is. And don't assume that you'd never make a dumb mistake like that, it happens even to the pros. The goal is not to always write perfect code on the first attempt because that's impossible, but to write code in a way that makes finding and fixing the inevitable bugs as easy as possible. See https://www.arduino.cc/en/Reference/Const for more information.
Avoid using delay. You will need to hold the light on the LDR for at least a second while the alarm is going because the LDR is not being read for the 1000ms that alarm() takes to run. That's not a very big problem in your application but in other situations, such as trying to detect the press of a button that will only be held for <100ms, it is. So best to always avoid blocking code since you may want to add other features to your program later that need it to run fast. Once you get the hang of writing non-blocking code it's just as easy as using delay. It's a lot of work to go back and convert blocking code to non-blocking code. Check out File > Examples > 02.Digital > BlinkWithoutDelay for an example of how to do this.