Posts

Write a windows program to output a blank box with your name given

Steps: 1. Open DEV C++. 2. Click “File” then “New” after that “Project”. 3. From “Basic” select “Wildows Application”. 4. Select “C++ project”. 5. Give a project name. 6. Click “ok” then “save”. Now you get the full program code here. You dont have to write the same code again and again for different programs. Steps: 1. From “Execute” menu click on “Compile and run”. 2. Give it a name and save it. 3. Wait until your compilation is completed by the compiler. 4. You see a blank box with the name “Caption”. 5. Close the blank box. 6. In your program code press CTRL+F. 7. Here you type the name “Caption” then click on “find”. 8. Change the word with “your name”. 9. From “Execute” menu click on “Compile and run” again. You get you result with your name printed on a blank box. #include <windows.h> /* This is where all the input to the window goes to */ LRESULT CALLBACK WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) { switch(Message) { /* Upon destruction, ...

Draw a flowchart and write a Java program to multiply two matrices

First we must download the Java SE Development Kit from (http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html). Then install it. After that set the path variable. Next write the following code in any text editor and save it [with it’s class name.java] in a particular location . Open CMD and set the saved file location. Then write javac filename.java and press enter. Then type java filename and press enter. Program code: import java.util.Scanner; class MatrixMultiplication { public static void main(String args[]) { Scanner r = new Scanner(System.in); System.out.println("Enter the number of rows of first matrix"); int rowFM = r.nextInt(); System.out.println("Enter the number of columns of first matrix"); int colFM = r.nextInt(); int first[][] = new int[rowFM][colFM]; System.out.println("Enter the elements of first matrix"); int loop1, loop2; for ( loop1 = 0 ; loop1 < rowFM ; loop1++ ) { for (loop2 = 0 ; loop2 < co...