First, you have to extract the individual digits from the original value of b so that they can be added together. Do that in a loop using the mod operator % to extract the right-most digit then divide by 10 to shift all digits right
int x = 0;
int b = 01234;
x += b % 10; // get right-most digit and save in x
b /= 10; // truncate right-most digit
once you get that working for both b and h come back and we'll work on the rest of the problem (unless of course you can do it yourself)
int b = 8, h = 14;
h+= b % 14;
b /= 14;
for( counter= 1; counter <= 14; counter++);
if (h <=8 && b <=14)
Nor appreciating that every time you see something like
" Last edited by Ancient Dragon : 39 Minutes Ago at 13:22. Reason: add code tags"
it represents time sucked away from helping people and instead wasted on doing what the poster should manage for themselves.
> for( counter= 1; counter <= 14; counter++)[B];[/B] Guess what the last ; on this line does.
Write a C program that should create a 10 element array of random integers (0 to 9). The program should total all of the numbers in the odd positions of the array and compare them with the total of the numbers in the even positions of the array and indicate ...
I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...