Question: 1. (6 marks) Which is better style 1, style 2, style 3, or style 4 (explain)? Consider the following: How scanf handles 'bad' data, i.e.

1. (6 marks) Which is better style 1, style 2, style 3, or style 4 (explain)? Consider the following: How scanf handles 'bad' data, i.e. data that cannot be converted into the desired data type? What is the acceptable range for the user data (your constraints)? Code complexity and ease of understanding the code? Flexibility and reusability of the code Style 1: Style 2: int Num; int Num = 100; do printf("Please enter a positive integer"); fflush(stdin); scanf("%d",& Num); while (Num
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
