logo

CuriousTab

CuriousTab

Discussion


Home Technical Questions Programming Comments

  • Question
  • Write a program for matrix multiplication in c


  • Correct Answer
  • #include int main() { int a[5][5], b[5][5], c[5][5], i, j, k, sum = 0, m, n, o, p; printf( "\nEnter the row and column of first matrix" ); scanf( "%d %d", &m, &n ); printf( "\nEnter the row and column of second matrix" ); scanf( "%d %d", &o, &p ); if(n!=o) { printf( "Matrix mutiplication is not possible" ); printf( "\nColumn of first matrix must be same as row of second matrix" ); } else { printf( "\nEnter the First matrix" ); for( i=0; i


  • Programming problems


    Search Results


    • 1. Write a c program for binary search.
    • Discuss
    • 2. Write a c program for merge sort.
    • Discuss
    • 3. Write a c program for insertion sort.
    • Discuss
    • 4. Write a c program for quick sort.
    • Discuss
    • 5. Write a c program for selection sort.
    • Discuss
    • 6. Write a c program to copy a data of file to other file.
    • Discuss
    • 7. What will be output of following c code? void main() { struct india { char c; float d; }; struct world { int a[3]; char b; struct india orissa; }; struct world st ={{1,2,3},'P','q',1.4}; clrscr(); printf("%dt%ct%ct%f",st.a[1],st.b,st.orissa.c,st.orissa.d); getch(); }
    • Discuss
    • 8. What is the output of this C code? #include void m() { printf("hi"); } void main() { m(); }

    • Options
    • A. hi
    • B. Run time error
    • C. None
    • D. Varies
    • Discuss
    • 9. The output of the code below is #include int *m() { int *p = 5; return p; } void main() { int *k = m(); printf("%d", k); }

    • Options
    • A. 5
    • B. Junk value
    • C. 0
    • D. Error
    • Discuss
    • 10. What would be the output of the following program? main() { extern int i; i = 20; printf( "%d", sizeof(i) ); }
    • Discuss


    Comments

    There are no comments.

Enter a new Comment