Question: Write the Pseudo code of this coding. #include #include int main(){ // file pointer FILE *ptr; // input 1 FILE *file1; file1 = fopen(matrixA-16by16.txt,r); //
Write the Pseudo code of this coding.
#include
int main(){ // file pointer FILE *ptr;
// input 1 FILE *file1; file1 = fopen("matrixA-16by16.txt","r");
// matrix float A[16][16];
// read all the data for(int i=0;i<16;i++){ for(int j=0;j<16;j++){ fscanf(file1,"%f",&A[i][j]); } }
// read matrix 2 // read all the data FILE *file2; file2 = fopen("vecX-16.txt","r"); float B[16][1]; for(int i=0;i<16;i++){ for(int j=0;j<1;j++){ fscanf(file2,"%f",&B[i][j]); } }
// perform multiplication float C[16][1]; int i,j,k; for(i=0;i<16;i++){ for(j=0;j<1;j++){ C[i][j] = 0; for(k=0;k<16;k++) C[i][j] += A[i][k] * B[k][j]; } }
// open file ptr = fopen("matrixA-vecX-result.txt","w"); for(int i=0;i<16;i++){ fprintf(ptr,"%f ",C[i][0]); }
fclose(file1); fclose(file2); fclose(ptr);
return 0;
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
