For 1D Array , solution would be like this :
Suppose two arrays are A & B of equal size n
int result = 0;
for(int i = 0; i < n; i++)
{
result = result + A[i]*B[i];
}
More Related Contents:
- String compare function in C [closed]
- Pointer Arithmetic [closed]
- Convert hex string (char []) to int?
- Passing multidimensional arrays as function arguments in C
- How can I suppress “unused parameter” warnings in C?
- Check substring exists in a string in C
- How do you convert a byte array to a hexadecimal string in C?
- What does i = (i, ++i, 1) + 1; do?
- Can C arrays contain padding in between elements?
- What is the purpose of the RBP register in x86_64 assembler?
- Bind failed: Address already in use
- C getopt multiple value
- Scatter Matrix Blocks of Different Sizes using MPI
- fork and existing threads?
- Octal number literals: When? Why? Ever? [closed]
- Is fmod() exact when y is an integer?
- Why we need Clobbered registers list in Inline Assembly?
- Why gets() is deprecated? [duplicate]
- Using true and false in C
- Is while(1); undefined behavior in C?
- How to set the IP address from C in linux
- Why does auto a=1; compile in C?
- Count number of digits – which method is most efficient?
- Linux function to get mount points
- Bitwise shifting array of char’s
- Using getchar() on c gets the ‘Enter’ after input [duplicate]
- strncpy leading to segmentation fault
- What exactly is -fno-builtin doing here?
- 2D Array indexing – undefined behavior?
- Pass va_list or pointer to va_list?