I have a triangle program in c
#include
// A function which decides the type of the triangle and prints it
void checkTriangle(int s1, int s
If you want to be able to detect an error with the user's input, such as a line not being a valid decimal integer, then you could do the following:
fgets(buffer, size, stdin)strtoul(buffer, &endptr, 10) to parse the buffer as a decimal integer (base 10), where endptr is a char*endptr will point to the first invalid character in buffer, ie. the character after the last one which was successfully parsed*endptr == '\0', ie. endptr points to the end of buffer, the whole string was parsed as a valid decimal integer