Contents
What can you not put after a semicolon?
Avoid using a comma when a semicolon is needed:
- Incorrect: The cow is brown, it is also old.
- Incorrect: I like cows, however, I hate the way they smell.
- Incorrect: I like cows: they give us milk, which tastes good, they give us beef, which also tastes good, and they give us leather, which is used for shoes and coats.
When should semicolons not be used?
As we have mentioned, you cannot use a semicolon to connect two unrelated independent clauses, although these can appear together as separate sentences. Incorrect: I hurt my knee; my dog needs someone to walk him. Correct: I hurt my knee. My dog needs someone to walk him.
What 3 things can a semicolon replace?
A semicolon is often used to replace a coordinating conjunction like ‘and’ or ‘but’. The sentence about Sandip could have been written like this: “Sandip spent three hours in the library but he couldn’t find the book he wanted.”
Which statement does not require semicolon?
Control statements ( if , do , while , switch , etc.) do not need a semicolon after them, except for do while , must have a semicolon after it.
What are the three semicolon rules?
There are three uses of the semicolon.
- Use a semicolon to connect (put together) two related, or similar, sentences.
- Use a semicolon to join two related, or similar, sentences when using a conjunctive adverb.
- Use a semicolon to connect items in a list if there are already commas in the sentence.
Why does the comment line not end with a semicolon?
Preprocessor directives are processed at relatively early stages of translation, before any syntax analysis begins, so at that stage there’s no such thing as “statement” yet. And, for this reason, there’s no meaningful rationale to demand ending the #include directive with a semicolon.
What do semicolons stand for?
Bamum semicolon. The semicolon or semi-colon ; is a symbol commonly used as orthographic punctuation. In the English language, a semicolon is most commonly used to link (in a single sentence) two independent clauses that are closely related in thought.
Are any command terminated with a semicolon?
3 Answers. Every command needs a semicolon (‘;’) at the end so the program knows that this is the end of the command, sometimes you need to stretch a command over more than one line so the semicolon comes at the end of the last line of this command. Scanner ; is a non-block statement.
What is a colon example?
A colon can be used to introduce a list. For example, “Here’s a list of groceries I need: a loaf of bread, a quart of milk, and a stick of butter.” The words preceding the colon stand as a complete, grammatically correct sentence.
When is it appropriate to use a semicolon?
A semicolon is used in place of a comma to separate phrases or items in a list or series when the phrases or items themselves contain commas or are especially long: Harry set out to find a dessert that would demonstrate his deep appreciation of Mabel’s meal.
Can you give an example of when to use a semicolon?
The scent of the baking bread was sublime, the perfume of the goulash intoxicating. A semicolon is also often used before introductory expressions such as for example, that is, and namely, in place of a colon, comma, dash, or parenthesis:
What is the proper use of a semicolon?
Semicolons are best described as the punctuation used when you want to avoid using a comma but cannot use a colon. Proper use of semicolons will allow your writing to flow smoothly and avoid reader confusion. Use semicolons to combine two independent clauses.
When to not use a semicolon?
You should not use a semicolon along with a conjunction such as “and” or “but,” because the semicolon takes the place of the connective word. There’s one additional use for semicolons: If you’re making a list and the components in the list include commas, you should use a semicolon to separate the list’s larger components.