foo.cc: In function ‘int main()’:
foo.cc:8:22: error: expected ‘;’ before ‘for’
8 | cnt=0
| ^
| ;
9 | for(i=1;i<=n;i++)
| ~~~
foo.cc:9:26: warning: statement has no effect [-Wunused-value]
9 | for(i=1;i<=n;i++)
| ~^~~
foo.cc:9:33: error: expected ‘;’ before ‘)’ token
9 | for(i=1;i<=n;i++)
| ^
| ;
foo.cc:15:25: error: ‘cout’ was not declared in this scope
15 | cout<<n<<" ";
| ^~~~
foo.cc:2:1: note: ‘std::cout’ is defined in header ‘<iostream>’; did you forget to ‘#include <iostream>’?
1 | #include <stdio.h>
+++ |+#include <iostream>
2 | using namespace std;