The exercise you have just played is a chromatic scale. Chromatic scales consist entirely of semitones (i.e., they move up or down one fret at a time). The start and finish notes of a particular chromatic scale are always the same, although they are an octave apart. This note gives its name to the scale and is referred to as the key note or tonic. A chromatic scale can be built on any of the twelve possible key notes.
Here is the D chromatic scale, ascending over one octave:
This is a natural sign.
A natural sign cancels the effect of a sharp or flat for the rest of that bar, or until another sharp or flat sign occurs within that bar.
A sharpened note stays sharp until either a bar line or a natural sign (@) cancels it as in the following example:
Now play this exercise which makes use of both sharp and natural signs. Play it slowly at first and say the name of each note out loud as you play it.
To improve your knowledge of sharps and natural signs, find each of the following notes on the fretboard of your guitar. Write the name of each note on a piece of paper.