added prompt for end
Signed-off-by: BuildTools <unconfigured@null.spigotmc.org>
This commit is contained in:
2
sum.c
2
sum.c
@@ -15,7 +15,7 @@ int main() {
|
|||||||
int* arr = malloc(size * sizeof(int));
|
int* arr = malloc(size * sizeof(int));
|
||||||
|
|
||||||
while(end_scan) {
|
while(end_scan) {
|
||||||
printf("Enter a number: ");
|
printf("(Type EOF to end) Enter a number: ");
|
||||||
if (scanf("%d", &(arr[pos])) == EOF) {
|
if (scanf("%d", &(arr[pos])) == EOF) {
|
||||||
end_scan = 0;
|
end_scan = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user