Loop error with for loop and loop control variable

Asked

Viewed 43 times

-6

the error written is inserir a descrição da imagem aqui

and my code is thisinserir a descrição da imagem aqui

someone can help me fix this bug?

The language is c

  • Oops, all right? I recommend you read this post, on how to ask questions. What about your code: Since you’re using the for loop to run multiple prints, you have to use wire fences to delimit which commands are inside and which are outside.

1 answer

2

What’s missing are the keys to the loop for.

#include <stdio.h>
void main(){
    for(int i = 0; i >= 1; i--){
        printf("%d garrafas de cerveja no muro\n", i);
        printf("bebo uma jogo no lixo\n");
        printf("%d garrafas de cerveja no muro\n", i - 1);
        if(i == 1){
            printf("1 garrafa de cerveja no muro\n")
            printf("bebo uma, jogo no lixo\n")
            printf("nenhuma garrafa de cerveja no muro\n")
        }
    }
}

Browser other questions tagged

You are not signed in. Login or sign up in order to post.