Which operator is used for assignment in C?
A. ==
B. =
C. :=
D. ->
Answer: Option B
Solution(By Examveda Team)
In C, the = operator is used for assignment. It is used to assign a value to a variable or a data location.Option A (==) represents the equality operator, used to compare two values for equality.
Option C (:=) is not a valid operator in C programming.
Option D (->) is used for accessing members of a structure or union through a pointer to that structure or union, not for assignment.
Related Questions on Operators and Expressions
What does the ++ operator do in C when applied to a variable?
A. Decrements by 1
B. Adds 1
C. Doubles the value
D. Leaves it unchanged
Join The Discussion