173k views
5 votes
Assume that isIsosceles is a bool variable, and that the variables isoCount, triangleCount, and polygonCount have all been declared and initialized. Write a statement that adds 1 to each of these count variables (isoCount, triangleCount, and polygonCount) if isIsosceles is true.

User Square
by
4.6k points

1 Answer

3 votes

Answer:

if(isIsosceles){

isoCount+=1;

triangleCount+=1;

polygonCount+=1;

}

Step-by-step explanation:

Here we are checking the condition for variable "isIsosceles" using if condition. if it is true then only if block executed and it will increment mentioned variable values by 1

User Silviu Burcea
by
4.8k points