I'm writing a program that adds the numbers from 1-5 and prints out the sum. It was working a week ago but today I got unused variable error and don't know where i'm wrong.
int main(int argc, const char * argv[]) {
int sum = 0;
int num;
for(int num=1; num<=5; num++){
sum = sum + num;
}
printf(" The sum of numbers 1 to 5 are %d",sum);
return 0;
}