PREMIUM
Join our WhatsApp Channel
Daily MCQs, Past Papers & Jobs for PPSC, FPSC, CSS
Daily MCQs • Past Papers • Jobs for PPSC, FPSC, CSS
Join Channel

What is an expression a collection of in programming?

A. Constants only
B. Variables only
C. Operands & Operators
D. Functions only
Correct Answer: C. Operands & Operators

Correct answer: Operands & Operators. An expression is operands and operators combined.

Background: Operands are values worked on, operators the symbols acting on them.

  • Constants only: Constants are fixed values, but an expression also needs operators.
  • Variables only: Variables change, but without operators there is no operation.
  • Functions only: Functions may appear in expressions, but these use operands and operators.

Did you know? 5 + 3 has two operands, 5 and 3, and one operator, plus.

Memory trick: Expression = operands operated on.

0 comments

Leave a Reply

Join Our WhatsApp Channel ×