Geeksforgeeks Solution For " Parallel or Perpendicular? "

GeeksforGeeks Solution For School Domain .Below You Can Find The Solution Of Basic ,Easy ,Medium ,Hard .You Can Also Direct Submit Your Solution to Geeksforgeeks Same Problem .You Need to login then you can submit you answers 

Problem :- Given two force vectors, find out whether they are parallel, perpendicular or neither. Let the first vector be A = a1 i +a2 j + a3 k and the second vector be B = b1 i + b2 j + b3 k.

A.B = a1*b1 + a2*b2 + a3*b3

A x B = (a2*b3 - a3*b2) i - (a1*b3 - b1*a3) j + (a1*b2 - a2*b1) k

|A|^2 = a1^2 + a2^2 + a3^2

If A.B = 0, then A and B are perpendicular.

If |A X B|^2 = 0, then A and B are parallel.

Submit Your Solution :- Click Here 

Solution :-

#include <iostream>
using namespace std;
int main()
    int t;
       int a1=0,a2=0,a3=0,b1=0,b2=0,b3=0,par,per;
       per= a1*b1 + a2*b2 + a3*b3;
       else if(per==0)
    return 0;



Geeksforgeeks Solution For " Parallel or Perpendicular? "

Previous Post
Next Post

post written by:

Hi, I’m Ghanendra Yadav, SEO Expert, Professional Blogger, Programmer, and UI Developer. Get a Solution of More Than 500+ Programming Problems, and Practice All Programs in C, C++, and Java Languages. Get a Competitive Website Solution also Ie. Hackerrank Solutions and Geeksforgeeks Solutions. If You Are Interested to Learn a C Programming Language and You Don't Have Experience in Any Programming, You Should Start with a C Programming Language, Read: List of Format Specifiers in C.
Follow Me