Matrix Multiplication

Description:           This program performs the multiplication of two Square Matrices.   Primary Inputs:    Two Square Matrices(3X3 only) Primary Output:    Product of two square matrices Platform Used:      Turbo C++ version 3.0, Borland International Inc.   /*program to find product of two matrices (3X3)*/ #include #include void main() { int a[3][3],b[3][3],c[3][3],i,j,k; clrscr(); printf("enter the first matrix\n"); for(i=0;i

Linked List

Description:           This program is Menu driven program for Creating/deleting items in the Linked List.   Primary Inputs:    number to be stored in the Linked List and its location Primary Output:    Linked List Platform Used:      Turbo C++ version 3.0, Borland International Inc.   /*program to implement Linked List*/ #include #include #include struct node { int data; struct node ...

Fibonacci

Description:           This program will generate the Fibonacci Sequence   Primary Inputs:    —– Primary Output:    Fibonacci Sequence Platform Used:      Turbo C++ version 3.0, Borland International Inc.   /*program to generate Fibonacci Sequence*/ #include #include #define MAX 10 void main() { int j,temp; int a=0,b=1,i=1; int fib[MAX]; clrscr(); fib[0]=0; fib[1]=1; while(i

Factorial

Description:           This program find the factorial of a given number.   Primary Inputs:    Number Primary Output:    Factorial of the given number Platform Used:      Turbo C++ version 3.0, Borland International Inc.   /*program to find factorial of a number*/ #include #include /*prototype declaration of a function*/ unsigned long int fact(int); void main() { int x; char another='y'; unsigned ...

Evaluate Postfix Expression

Description:           This program evaluates a given postfix expression.   Primary Inputs:     A postfix expression Primary Output:    The evaluated result of the given postfix expression. Platform Used:      Turbo C++ version 3.0, Borland International Inc.   #include #include #include #include /*Maximum size of the postfix expression to take*/ #define maxsize 50 struct post { double stack[maxsize/2]; char exp[maxsize]; ...

Binary Search 1

Description:           This program implements the binary search algorithm.   Primary Inputs:    An array of 10 numbers (sorted in increasing order), and another number to be searched. Primary Output:    Gives the location of the number in the array(if found). Platform Used:      Turbo C++ version 3.0, Borland International Inc.   /* This program implements the Binary * Search Algorithm on ...

Binary Adder

Description:           This program performs the addition of two binary numbers.   Primary Inputs:    Two binary numbers Primary Output:    Summation of the two input binary numbers Platform Used:      Turbo C++ version 3.0, Borland International Inc.   /* This program adds two binary numbers */ #include #include #include #define null 0 struct node { struct node *next; /*Pointer to next ...

Adding rows and columns in JTable dynamically 5

Adding rows and columns in JTable dynamically
Java Source code to add Row and Column in JTable dynamically package com.example; import java.awt.BorderLayout; import java.awt.EventQueue; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.ArrayList; import java.util.Vector; import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTable; import javax.swing.WindowConstants; import javax.swing.table.DefaultTableModel; import javax.swing.table.TableColumn; import javax.swing.table.TableColumnModel; public class JTableSample { private JFrame mainFrame ; private JTable ...

Russian Peasant Multiplication 2

Russian Peasant Multiplication
Description: Russian Peasant Multiplication. This program allows one to do multiplication by just doing muliplication or division by 2 (and addition). This is interesting since computers generally use base 2 arithmetic.The algorithm is as follows. Start two rows, one with the multiplicand (say, A) and the other the multiplier (say B). The goal is to ...