I was writing a program that calculates volume of a triangular prism. However it came to my attention that integers larger than what can be stored will cause errors so I placed certain restrictions onto what can be inputted.
Now the problem at hand is when someone types more than the set number of integers that i tell the program to read.
eg
and I enter 4 integers the program will still run correctly based on the first three integers (or if less than 3 integers were entered the program will not cease). I was wondering if there was a solution to this (i've tried a loop but that doesn't seem to work), or a function that can be used.
Now the problem at hand is when someone types more than the set number of integers that i tell the program to read.
eg
Code:
scanf("%d %d %d", &a, &b, &c);
Comment