Skip to main content

Posts

Showing posts from July, 2023

Product of two Same order Matrices in C

  This code calculates the product of two matrices entered by the user. It uses the standard libraries ` stdio.h `, ` stdlib.h `, and ` string.h `. After clearing the screen, it prompts the user to enter the number of rows and columns for the matrices. It then declares three matrices: ` a `, ` b `, and ` product `. The code proceeds to prompt the user to enter the elements of the first and second matrices. Next, it computes the product of the matrices using nested loops and stores the result in the `product` matrix. Finally, it prints the resulting matrix. Source Code : MatrixProductSameOrder.C # include <stdio.h> #include <stdlib.h> #include <string.h> int main (){     int row , columns ;     // this line will clear the screen using stdlib.h file     system ( "cls" );     // getting number of rows and columns from user     printf ( "Enter the number of Rows and Columns of the matrices : " );     ...

Lexicographical Order in C language

  This code is a C program that sorts a given number of strings in lexicographical order. It begins by asking the user to enter the number of strings. Then, it prompts the user to input each string one by one. After obtaining all the strings, it uses nested loops and the `strcmp` function to compare and sort the strings in lexicographical order. Finally, it prints the sorted strings to the console. The code utilizes the standard libraries `stdio.h`, `stdlib.h`, and `string.h` for input/output operations, memory allocation, and string manipulation, respectively. Watch full  Video on YouTube Now - LEXICOGRAPHICAL ORDER Source code of this program : Lexicographic.C #include <stdio.h> #include <stdlib.h> #include <string.h>   int main (){        int number ;        char string [ 10 ][ 100 ], s [ 100 ];        printf ( "Enter number of strings : " );        scanf ( " %d " ...