-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheuler_problem1.c
More file actions
32 lines (27 loc) · 838 Bytes
/
euler_problem1.c
File metadata and controls
32 lines (27 loc) · 838 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
void main(void)
{
//Introduce the function of the program and request user input
printf("This program will calculate the sum of all the natural numbers,");
printf("that are multiples of 3 or 5 below a number of your choice.\n");
printf("What number do you want to try?\n");
scanf(%d, uint64_t input_value); // here we need to get the save what was input from the user.
//keep the checks in a separate function
bool b_valid_number = check_for_valid_input(input_value);
if (true == b_valid_number)
{
}
// Compute calculations and run test
}
// Doxygen comments.
bool check_for_valid_input(uint64_t number)
{
upper_limit = 1000000u;
lower limit = 0u;
assert(lower_limit < number);
assert(upper_limit > number);
printf("The number is valid!");
return true;
}