Question: Help complete this program to determine the direction made by points in a quadrant: #include #include int kindofturn( int x1, int y1, int x2, int
Help complete this program to determine the direction made by points in a quadrant:
#include #include int kindofturn( int x1, int y1, int x2, int y2, int x3, int y3 )
{
Your code
}
int main( int argc, char *argv[] )
{
int x1, y1, x2, y2, x3, y3, turn ;
x1 = atoi( argv[1] ) ;
y1 = atoi( argv[2] ) ;
x2 = atoi( argv[3] ) ;
y2 = atoi( argv[4] ) ;
x3 = atoi( argv[5] ) ;
y3 = atoi( argv[6] ) ;
turn = kindofturn( x1, y1, x2, y2, x3, y3 ) ;
if ( turn == 0 )
printf( " The points make a straight line. " ) ;
if ( turn < 0 ) printf( " The points make a right turn " ) ;
if ( turn > 0 ) printf( " The points make a left turn. " ) ;
printf( " " );
return 0 ;
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
