February 2020
Beginner to intermediate
616 pages
15h 16m
English
Follow these steps to create a validation check using assertion. The recipe will not allow the program to run if the value of the number of passengers is zero or negative:
printf("How many passengers ? ");scanf("%d",&noOfPassengers);
assert(noOfPassengers > 0 && "Number of passengers should be a positive integer");
Read now
Unlock full access