prog.cpp: In function ‘int main()’:
prog.cpp:6:20: error: ‘printf’ was not declared in this scope
printf("enter num");
^
prog.cpp:7:15: error: ‘scanf’ was not declared in this scope
scanf("%d",&i);
^
prog.cpp:5:7: warning: unused variable ‘num’ [-Wunused-variable]
int num,i;
^