Vidyalelo
C Programming · Q16

Operators and Expressions

Programming · C Programming · question 16

Q16

Which operator is used for assignment in C?

A.
==
B.
=
Answer
C.
:=
D.
->

Answer: Option B

Solution

Answer: Option B
Solution:
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.