โ Back to Structs
Question 345
Dot Product of Two Vectors
Dot Product of Two Vectors
Two vectors are given:a = {1, 2}andb = {3, 4}. The dot product isa.x*b.x + a.y*b.y. Compute and print it: 11 That is1*3 + 2*4 = 3 + 8 = 11. There is no trailing newline.
Expected Output:
11
Topics:
Structs
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท Ctrl+Space to expand shortcuts (p, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.