100% inner product
#include<stdio.h>
void main()
{
int a[3]={1,2,-1};
int b[3]={1,0,1},i,total=0; //total is used to store inner product
for(i=0;i<3;i++)
{
total=total+a[i]*b[i];
}
printf("\n inner product is : %d",total);
if(total==0)
{
printf("\n the given vectors are orthogonal to each other");
}
else
{printf("\n the two vectors are not orthogonal");
}
}
void main()
{
int a[3]={1,2,-1};
int b[3]={1,0,1},i,total=0; //total is used to store inner product
for(i=0;i<3;i++)
{
total=total+a[i]*b[i];
}
printf("\n inner product is : %d",total);
if(total==0)
{
printf("\n the given vectors are orthogonal to each other");
}
else
{printf("\n the two vectors are not orthogonal");
}
}
తెరమీద
inner product is : 0
he given vectors are orthogonal to each othe
కామెంట్లు
కామెంట్ను పోస్ట్ చేయండి
దయచేసి మీ సలహాలను సూచనలను స్పష్టంగా పేర్కొనగలరు. plz see that ur comments are 'acceptable' in a value based society.