Hello fellow programmers

!
I want to share with you my solution to Exercise 1, Ch.5:
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[])
{
@autoreleasepool
{
int number, maxCount, squaredNumber;
NSLog(@"What Range of Squared Numbers Do You Want - Starting from 1 - ?");
scanf("%i", &number);
maxCount = number;
NSLog(@"TABLE OF SQUARED NUMBERS");
NSLog(@"Number Squared Number");
NSLog(@"------ --------------");
for (int count = 1, number = 1; count <= maxCount; ++count, ++number)
{
squaredNumber = pow(number, 2);
NSLog(@" %2i %10i",number, squaredNumber);
}
}
return 0;
}
OUTPUT:
What Range of Squared Numbers Do You Want - Starting from 1 - ?
14
TABLE OF SQUARED NUMBERS
Number Squared Number
------ --------------
1 1
2 4
3 9
4 16
5 25
6 36
7 49
8 64
9 81
10 100
11 121
12 144
13 169
14 196