I am new to the coding world, and have been struggling a lot. In my course "intro to programming" I will be learning about the C language. I needed help on how to do an arithmetic sequence in visual studio using and containing two constant values for weeks in a year (should be set to 52) and months in a year (value should be set to 12).
I will list the directions below.
write a program that takes numeric inputs from a user, uses these values in various math calculations, and then displays the results of these computations to the user at certain intervals within program.
User will have to enter two numeric values (value A and Value B)and program should contain two constant values for weeks in yr (need to set to 52) and months in a year (need to set to 12)
first facsimile should look like this
Please enter Value A: ## (in this case i wanted to use 10)
Please enter Value B: ## (in this case i wanted to use 20)
after numbers are entered program should conduct following calculations. (results to calculations should be stored at a later stage in the program.
double a, b, c, d, e, f, g, h;
printf("Please enter Value A> ");
printf("Please enter Value B> ");
c = b - a;
d = b + b;
e = a * c;
f = b / d;
g = DO NOT KNOW HOW TO MAKE CONSTANTS??
h = c * e;
printf("The result of the difference of %f subtracted from %f is %f\n", a, b, c);
printf("The result of %f added to %f is %f/n", b, b, d);
printf("The result of the product of %f multiplying by %f is %f\n", a, b, e);
printf("The result of the quotient of dividing %f by %f is %f\n", b, d, f);
printf("The result of the remainder of dividing the ?? in a year by the ?? in a year is %f/n",??, ??, ??);
printf("The result of the product of multiplying the answer of %f by the answer of %f is %f/n", c, e, h);
printf("The result of the sum of the product of %f
In C, there are two different types of constants:
#define token [value] // example: #define NUMBER_X 100
static int const varX = 5
The last one, you could achieve by enum too, for example.