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 .

1
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 .

LANGUAGE: C++

CHALLENGE:

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.

SOLUTION:


if(isIsosceles){
    isoCount++;
    triangleCount++;
    polygonCount++;
}

One comment

Add comment