Check your program carefully before submission Test data dif
Solution
void vector_input(float v[],int n)
{
printf(\"Enter %d values \",n);
for ( int j=0;j< n;j++){
printf(\"enter the integer number %d\ \", x);
scanf(\"%f\", &v[j]);
}
}
----------------------------------------------------------
void vector_output(float v[],int n){
printf(\"Values in vector are: \ \");
for (int j=0; j<n; j++)
{
printf(\"%d ,\", v[j] );
}
----------------------------------------------------------------------
void vector_add(float v1[],flaotv2[],float v3[],int n){
int j;
float v3[];
for( j =0;j<n;j++)
{
v3[j]= v1[j] + v2[j];
}
System.out.println(\"vector_add: \");
for ( j=0; j<n; j++)
{
printf(\"%d ,\", v3[j]);
}
}
-------------------------------------------------------------------
void vector_multiply(float v1[],float x,int n){
int j;
for( j =0;j<n;j++)
{
v1[j]= x * v2[j];
}
System.out.println(\"vector_multiply: \");
for ( j=0; j<n; j++)
{
printf(\"%d ,\", v1[j]);
}
}
----------------------------------------------------------------------
float inner_product(float v1[],float v2[],int n){
int j;
float inner_prd=0;
float v3[n];
for(j=0;j<n;j++){
v3[j]=v1[j]*v2[j];
}
for(j=0;j<n;j++){
inner_prd=inner_prd+v3[j];
}
System.out.println(\"Inner_product is %f:\",inner_prd);
}
-------------------------------------------------------------------------
float length(float v[],int n){
int j;
float len=0;
for(j=0;j<n;j++){
len=len+(v[j]*v[j]);
}
printf(\"Length: %lf \",sqrt(len));
}

