fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int cont = 0;
  5. float lista = [20];
  6. printf("digite ate 20 valores\n");
  7. while (cont <= 20);
  8. {
  9. scanf("%f", &lista[cont]);
  10. printf("%f", lista[cont]);
  11. }
  12. return 0;
  13. }
  14.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function ‘main’:
prog.c:5:16: error: expected expression before ‘[’ token
  float lista = [20];
                ^
prog.c:7:2: warning: this ‘while’ clause does not guard... [-Wmisleading-indentation]
  while (cont <= 20);
  ^~~~~
prog.c:8:2: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘while’
  {
  ^
prog.c:9:21: error: subscripted value is neither array nor pointer nor vector
   scanf("%f", &lista[cont]);
                     ^
prog.c:10:21: error: subscripted value is neither array nor pointer nor vector
   printf("%f", lista[cont]);
                     ^
prog.c:5:8: warning: variable ‘lista’ set but not used [-Wunused-but-set-variable]
  float lista = [20];
        ^~~~~
stdout
Standard output is empty