Question from the Language C - Fundamentals test

Write a C program that prints the number of years a child needs to grow to be able to ride a roller coaster.

Easy

What is the value of the variable "year" at the loop output?

int main()
{
        double height = 1.05;
        int year= 0;
        do
        {
            printf("you're too small for this ride, come back next year\n");
            year++;
            height+= 0.20;
        } while (height < 1.25);
        printf("%d",year);
        return 0;
   }
Author: KahinaStatus: Published(Update)Question passed 268 times
Edit
1
Community EvaluationsNo one has reviewed this question yet, be the first!