2 ms·
The first listed program to add up all the integers from 1 to the scanned number wouldn't compile under GCC for me and the error was that "i" undeclared (first
by throwaway7645 9y ago
The first listed program to add up all the integers from 1 to the scanned number wouldn't compile under GCC for me and the error was that "i" undeclared (first use in this function). I had to declare "i" as an "int" to make it work. It looks like it accepted the declaration in the top with num and result or within the for loop.