Hi guys ! could you help me to resolve my problem of this quiz ?Attachment 15494
this is my code :
I've search about this article in youtube, google and my university's site, but it doesn't help, I couldn't find the answer.Code:#include <stdio.h>#include <stdlib.h>
int main()
{
int counter;
int num;
scanf("%d", &counter);
printf("Case #1");
while(counter != 0)
{
printf("\n%d", counter);
counter --;
sleep(1);
}
for(num=5)
{
printf("test");
}
return 0;
}
the code's result say this :
please help me guys.Code:/Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake --build /Users/audynaufal/CLionProjects/untitled/cmake-build-debug --target untitled -- -j 2Scanning dependencies of target untitled
[ 50%] Building C object CMakeFiles/untitled.dir/main.c.o
/Users/audynaufal/CLionProjects/untitled/main.c:15:9: warning: implicit declaration of function 'sleep' is invalid in C99 [-Wimplicit-function-declaration]
sleep(1);
^
/Users/audynaufal/CLionProjects/untitled/main.c:17:14: error: expected ';' in 'for' statement specifier
for(num=5)
^
/Users/audynaufal/CLionProjects/untitled/main.c:17:14: error: expected ';' in 'for' statement specifier
1 warning and 2 errors generated.
make[3]: *** [CMakeFiles/untitled.dir/main.c.o] Error 1
make[2]: *** [CMakeFiles/untitled.dir/all] Error 2
make[1]: *** [CMakeFiles/untitled.dir/rule] Error 2
make: *** [untitled] Error 2