Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please help me to find the right answer: 1. The equals sign “=” is used as a) Is

ID: 2246452 • Letter: P

Question

Please help me to find the right answer:

1. The equals sign “=” is used as

a) Is the “assignment” operator and computes the right side, takes that value and stores it in the variable on the left side

b) A “test” operator to test to see if the value on the left side equal the value on the right side and returns true if they are equal

c) Is used as a test operator in the if statement and the assignment operator in a simple expression

2. Which is an example of a valid “for” statement?

a) for(int i = 0 ; i < 5 ; i++)

b) for(string i ; i = 0 ; i++)

c) for(char i = 0 ; i < 8 ; j++)

Explanation / Answer

1. The equals sign “=” is used as
a test operator in the if statement and the assignment operator in a simple expression.
The equal sign '=' is a relational operator which check whethere is some relations between two entities to which it is assign.

2. Which is an example of a valid “for” statement?
a) for(int i = 0 ; i < 5 ; i++)

Because i second statement they have used string and comapring or checking it's value with integer in next step which is not valid.

And in third statement they have used character and comapring or checking it's value with integer in next step which is not valid.
As in for loop the variable should be same in though out the statement.