#include <stdio.h> int main(int argc, char *argv[]) { int number; int places = 0; scanf("%d", &number); if ( number == 0 ) { number = 1; } for ( int counter = 1; counter <= number; counter *= 10 ) { places += 1; } printf("%d\n", places); return 0;}
Standard input is empty
prog.c: In function ‘main’: prog.c:12:5: error: ‘for’ loop initial declarations are only allowed in C99 mode for ( int counter = 1; counter <= number; counter *= 10 ) { ^ prog.c:12:5: note: use option -std=c99 or -std=gnu99 to compile your code
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!