Computer Science, asked by 8472, 8 months ago

3. Correct the following code fragment :
if (x = 1)
k = 100;
else​

Answers

Answered by Navvya1207
32

Answer:

if (x==1)

k=100;

else

Explanation:

whenever we use if else statement we use the == operator

Answered by Jasleen0599
2

The correct C programming c o d e will be:

if ( x == 1 )

         k = 100 ;

else

In C language or any other programming language,

  • '=' operator is an assignment operator. An assignment operator is an operator used to assign another worth to a variable, property, occasion, or indexer component in the C# programming language.
  • ' = = ' on the other hand, is an equality operator. The equality operator ( == ) checks whether its two operands are equal, returning a Boolean outcome. Dissimilar to the severe equality operator, it endeavors to change over and look at operands that are of various kinds.
Similar questions