C# C# Basics C# Syntax Variables

Why Don't you put inverted commas around 4 in var number = 4;

In the nextstep inverted commas were around hello but not around 4 why?

1 Answer

Steven Parker
Steven Parker
203,731 Points

i believe what you are referring to as "inverted commas" is typically called "quote marks" or just "quotes".

And quotes are used around strings, but not around numbers. You can do math (like "number + 1") only on numbers.