Trying to write a program to work on a triangle, the user inputs information in the format P0 x y, P1 x y ... but if the user inputs Q then the program terminates. I understand the scanf function will be used, along with if else statements with logical operators, however i'm not sure how to accomplish it.
When i run the code and type 'Q' it still asks for 2 more prompts. I was thinking about using a string array but not sure how, and suggestions would be great, thanks.
#include <stdio.h>
void main()
{
float x, y;
char Q, input;
scanf("%c %f %f", &input, &x, &y);
if (input == 'Q')
return;
else
printf("points are %f %f", x, y);
return(0);
}