Skip to main content

Posts

Showing posts with the label The Crazy Programmer Expression vs Statement in Programming Expression vs Statement in Programming The Crazy Programmer

Expression vs Statement in Programming Nitish Agarwal The Crazy Programmer

In this article, we will study two popular terms in the programming language Expression vs Statement and take a look at the differences between the two. In the programming world, an Expression is a function or a combination of characters, variables, and operators combined together to produce a certain value. These expressions are interpreted by the programming language and converted to produce a value through the process of evaluation. The value obtained is of a primitive type which includes integer, float, boolean, string, or other data types. For example: value = a + b/5 Types of Expressions 1. Integral Expressions: As the name suggests, these kinds of expressions return an integer value. Even if a floating value is used in the expression, it is converted into an integer explicitly by the user. For example: value = (int)5.0 – b*a 2. Floating Expressions: These kinds of expressions return a floating value. Even if an integral value is used in the expression, it is converted