//
// ViewController.m
// PercentFinder
//
// Created by Danny Flax on 6/21/09.
// Copyright 2009 __MyCompanyName__. All rights reserved.
//
#import "ViewController.h"
#import <stdio.h>
#import "PercentFinderAppDelegate.h"
@implementation MyViewController
@synthesize C;
-(IBAction)Solve:(UIButton*)sender{
[C resignFirstResponder];
NSString*as=[A text];
float a=[as intValue];
NSString*bs=[B text];
float b=[bs intValue];
NSString*cs=[C text];
float c=[cs intValue];
float d=((-1*b)+sqrt((b*b)-4*(a*c)))/(2*a);
float e=((-1*b)-sqrt((b*b)-4*(a*c)))/(2*a);
printf("%f and %f\n",d,e);
[Answer setText:[NSString stringWithFormat:@"%f and %f",d,e]];
}
@end