Apologies for the dumb question off the bat, I'm sure it's an easy answer. Trying to learn C, when I complete the program, save, chmod +x num.c, then try and run it, I get the error below.
./num.c: line 2: syntax error near unexpected token `('
./num.c: line 2: `int main()'
Am I getting this error as I haven't complied it first? Or is it a problem with how I've written the code?
Thanks
- Code: Select all
#include <stdio.h>
int main()
{
int Number1; // 1
int Number2; // 3
int Number3; // 5
Number1=13579 // 2
Number2=2468 // 4
sum=Number1+Number2; //6
printf("%d",sum);
return 0;
}