I am just starting xcode, and am fiddling with basic c, such as performing algebraic math equations. I already wrote a program which runs in terminal and shows conversion between Fahrenheit and Celsius, from 0 to 200. That works fine. Now, without guidance, I am writing the code for the so complex equation of y = mx + b. Whenever I run this, it only shows the output for 51 as x to 105 y! Here's the script:
Thank you!
Code:
#import <Foundation/Foundation.h>
int main (int argc, const char * argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int xscope, yscope;
int slope = 2;
int intercept = 3;
for (xscope = 0; xscope <= 50; xscope = xscope + 1);
{
yscope = (slope * xscope) + intercept;
NSLog(@"%10.2i -> %10.2i", xscope, yscope);
}
[pool drain];
return 0;
}