Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #define VALUE 5
- main()
- {
- int i, num[VALUE] = { 0 }, count = 0;
- printf("Enter numbers until you enter 5 values or enter -999:\n");
- for (i = 0; i < VALUE && num[i-1] != -999; i++)
- {
- count++;
- scanf_s("%i", &num[i]);
- if (i == -999) {
- count--;
- break;
- }
- }
- printf("\nThe numbers you entered are:\n");
- for (i = 0; i < count; i++)
- {
- printf("%i\n", num[i]);
- }
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement