#include <stdio.h> int main(){ int valor; for(int i = 1; i <= 5; i++){ printf("Valor %d: ", i); scanf("%s", &valor); printf("%d\n", valor); } return 0; }
Standard input is empty
prog.c: In function ‘main’: prog.c:8:15: error: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘int *’ [-Werror=format=] scanf("%s", &valor); ~^ ~~~~~~ %ls cc1: all warnings being treated as errors
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!