Answer:
It depends on the structure of the sentence.
Step-by-step explanation:
This will be shown as grammatical mistake because both the spellings are correct. If we write the word weather instead of the whether, Ms word shows the grammatical mistake. This is because, if we want to write the word whether, we should use or in our sentence. Both of these words are comes together.
Example
I will take a leave whether its raining or not.
In above sentence, both whether and or comes together. If we write weather instead of whether it just show the grammatical mistake in the sentence.