-2
I’m having trouble with code output, I come from Python and I’m a little lost in the C language, what happens is this: I run the code but it simply ignores the input of the condition variable, it doesn’t let the user dictate the value , simply jumps and falls in "Type to see even numbers "...
I’ve tried a lot and I can’t fix it, I’ll keep waiting for a hint.
#include <stdlib.h>
#include <stdio.h>
int main(){
int quant;
char decisao = 's';
while(decisao){
printf("Digite até onde deseja ver pares : ");
scanf("%d",&quant);
for(int num = 0; num < quant ; num = num + 2) {
printf("%d\n",num);
}
printf("DESEJA CONTINUARR ?\n");
fflush(stdin);
scanf("%c",&decisao);
}
}
Thanks help Vinicius, it worked perfectly :)
– Pedro Linhares