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