logo CodeStepByStep logo

stars_print

Language/Type: C expressions %

What output is produced by each of the following code samples?

// A)
for (int i = 0; i < 5; i++) {
    for (int j = 0; j < 10; j++) {
        printf("*");
    }
    printf("\n");
}
// B)
for (int i = 1; i <= 5; i++) {
    for (int j = 1; j <= i; j++) {
        printf("*");
    }
    printf("\n");
}
// C)
for (int i = 1; i <= 5; i++) {
    for (int j = 1; j <= i; j++) {
        printf("%d", i);
    }
    printf("\n");
}
A)
B)
C)

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.