The post How to do Message Encoding in C Program using Matrix Multiplication? appeared first on Get Program Code.

]]>**Source Code**

/* Restriction: Input string has to be in lower case without any special characters */ #include <stdio.h> #include <string.h> void mul(int first[3][3], int second[3][10], int result[3][10]) { int c, d, sum, k; int i, j; for ( c = 0 ; c < 3 ; c++ ) { for ( d = 0 ; d < 10 ; d++ ) { sum = 0; for ( k = 0 ; k < 3 ; k++ ) { sum = sum + first[c][k] * second[k][d]; } result[c][d] = sum; } } } int main() { char str[29] = "this message is to be encoded"; int len; int i, j; int result[3][10] = {0}; int key[3][3] = { {-3, -3, -4}, {0, 1, 1}, {4, 3, 4} }; int inv_key[3][3] = { {1, 0, 1}, {4, 4, 3}, {-4, -3, -3} }; int encode[3][10] = {32}; int decode[3][10] = {0}; len = strlen(str); for (i = 0; i < 10; i++) { for(j = 0; j < 3; j++) { if (str[j + i*3] >='a' && str[j + i*3] <='z') { encode[j][i] = str[j + i*3] - 96; } if (str[j + i*3] == 32) { encode[j][i] = 32; } if (str[j + i*3] == '\0') break; } if (str[j + i*3] == '\0') break; } mul( key, encode, result); printf("\nEncoded message to be sent: "); for (i = 0; i < 10; i++) { for ( j = 0 ; j < 3; j++) printf("%d, ", result[j][i]); } printf("\nDecoded message is: "); mul(inv_key, result, decode); for (i = 0; i < 10; i++) { for ( j = 0; j < 3; j++) { if ( ((decode[j][i]+96)) >= 97 && ((decode[j][i]+96) <= 123)) printf("%c", (decode[j][i] + 96) ); else if ( decode[j][i] == 32) printf(" "); else return; } } return 0; }

**Output**

$ gcc encode.c -o encode $ ./encode Encoded message to be sent: -120, 17, 140, -205, 45, 224, -148, 38, 153, -44, 12, 45, -199, 28, 231, -216, 35, 248, -122, 7, 154, -167, 19, 199, -70, 19, 73, -27, 4, 32, Decoded message is: this message is to be encoded.

So using this C program code for message encoding using Matrix multiplication, you can do message encoding in a c program easily.

The post How to do Message Encoding in C Program using Matrix Multiplication? appeared first on Get Program Code.

]]>The post How to find inverse of a matrix in C programming? appeared first on Get Program Code.

]]>**Source Code for finding inverse of a matrix in C**

#include<stdio.h> #include<math.h> float determinant(float [][25], float); void cofactor(float [][25], float); void transpose(float [][25], float [][25], float); int main() { float a[25][25], k, d; int i, j; printf("Enter the order of the Matrix : "); scanf("%f", &k); printf("Enter the elements of %.0fX%.0f Matrix : \n", k, k); for (i = 0;i < k; i++) { for (j = 0;j < k; j++) { scanf("%f", &a[i][j]); } } d = determinant(a, k); if (d == 0) printf("\nInverse of Entered Matrix is not possible\n"); else cofactor(a, k); } /*For calculating Determinant of the Matrix */ float determinant(float a[25][25], float k) { float s = 1, det = 0, b[25][25]; int i, j, m, n, c; if (k == 1) { return (a[0][0]); } else { det = 0; for (c = 0; c < k; c++) { m = 0; n = 0; for (i = 0;i < k; i++) { for (j = 0 ;j < k; j++) { b[i][j] = 0; if (i != 0 && j != c) { b[m][n] = a[i][j]; if (n < (k - 2)) n++; else { n = 0; m++; } } } } det = det + s * (a[0][c] * determinant(b, k - 1)); s = -1 * s; } } return (det); } void cofactor(float num[25][25], float f) { float b[25][25], fac[25][25]; int p, q, m, n, i, j; for (q = 0;q < f; q++) { for (p = 0;p < f; p++) { m = 0; n = 0; for (i = 0;i < f; i++) { for (j = 0;j < f; j++) { if (i != q && j != p) { b[m][n] = num[i][j]; if (n < (f - 2)) n++; else { n = 0; m++; } } } } fac[q][p] = pow(-1, q + p) * determinant(b, f - 1); } } transpose(num, fac, f); } /*Finding transpose of matrix*/ void transpose(float num[25][25], float fac[25][25], float r) { int i, j; float b[25][25], inverse[25][25], d; for (i = 0;i < r; i++) { for (j = 0;j < r; j++) { b[i][j] = fac[j][i]; } } d = determinant(num, r); for (i = 0;i < r; i++) { for (j = 0;j < r; j++) { inverse[i][j] = b[i][j] / d; } } printf("\n\n\nThe inverse of matrix is : \n"); for (i = 0;i < r; i++) { for (j = 0;j < r; j++) { printf("\t%f", inverse[i][j]); } printf("\n"); } }

**Output of source code**

$ gcc inverse_matrix.c -o inverse_matrix $ ./inverse_matrix Enter the order of the Square Matrix : 3 Enter the elements of 3X3 Matrix : 3 5 2 1 5 8 3 9 2 The inverse of matrix is : 0.704545 -0.090909 -0.340909 -0.250000 -0.000000 0.250000 0.068180 0.136364 -0.113636

So this is how using the C program for finding inverse of a matrix in C, you can easily find matrix inverse in C program.

For more, keep checking program code examples.

The post How to find inverse of a matrix in C programming? appeared first on Get Program Code.

]]>The post How to Solve Linear Equation in One Variable In C Programming? appeared first on Get Program Code.

]]>Find complete C program to solve Linear equation in one variable. This is one of the most important mathematical programs for C to know how to solve linear equation in C program.

#include <stdio.h> #include <string.h> float solve_for_y(float a, float b, float c) { float Y = Y = -(b + c) / a; return Y; } main() { float a, b, c, Y; printf("\nEnter a linear equation in one variable of the form aY + b + c = 0 "); printf("\nEnter the value of a, b, c respectively: "); scanf("%f%f%f", &a, &b, &c); Y = solve_for_y(a, b, c); printf("\nSolution is Y = %f", Y); }

$ gcc linear_equation.c -o linear_equation $ ./linear_equation Enter a linear equation in one variable of the form aY + b + c = 0 Enter the value of a, b, c respectively: 2 4 8 Solution is Y = -6.000000

For more related C program examples like C program for solving linear equation in one variable, keep checking Program code examples.

Source – http://www.sanfoundry.com/c-programming-examples-numerical-problems-algorithms/

The post How to Solve Linear Equation in One Variable In C Programming? appeared first on Get Program Code.

]]>The post Windows Store Cache may be Damaged appeared first on Get Program Code.

]]>Also Check: Activation Code for Windows 10 Free

**Method 1**

To fix the issue just follow the below given steps and your problem will be solved:

**Step 1:** Press ** + R** it will open the command prompt. In it, type **C:\Windows\System32 **and press **Enter**. Remember to **replace C:**

**Step 2:** Now scroll down in the *System32* folder, and find **WSReset.exe** application. Right-click on it and click on **Run as administrator**.

**Step 3: **Now in the *UAC* prompt press **Yes** **Button** which will reset *Windows Store* *application* without changing your settings and other installed apps.

After completion of the above-given process your Windows Store will be automatically opened by the Windows and after this, you can use it as you were using it before.

**Method 2**

You can also follow this method alternatively if the above-given solution didn’t work out for you.

**Step 1:** Press ** + R** and type the below given location in the *Run* *Box* and Press **OK**.

C:\Users\<USERNAME>\AppData\Local\Packages\Microsoft.WindowsStore_8wekyb3d8bbwe\LocalState

**Replace C: with system root drive and <USERNAME> with the user account name. AppData folder is automatically hidden by default.
*

**Step 2:** Now in the **LocalState** folder, search for *Cache* folder and rename it to *Cache.old*. After this create a new folder and name it as **Cache**. In case the *Cache* folder doesn’t come by default then just create a new folder and name it **Cache**.

You can also check the video tutorial to know how to solve this issue. (video by Kapil Arya)

The post Windows Store Cache may be Damaged appeared first on Get Program Code.

]]>The post How to Airdrop from iPhone to Mac appeared first on Get Program Code.

]]>Also Check: Activation Code for Windows 10 Free

**On your Mac device: **

- Select
**Go**>**AirDrop**from the menu bar in the Finder. Now, an**AirDrop**window will open. - If the Bluetooth or Wi-Fi is off,
**turn it on**by clicking the button which is already located there. Turning On the Bluetooth or Wi-Fi automatically turns on the Airdrop feature.

**On Phone and iPad: **

- Open the Control Center on your iOs device.
- Click on
**AirDrop**, then select whether you want to receive files from everyone or only from people in your Contacts app.

In order to send or receive various files between iPhone, iPad, or iPod touch, you should have a 2012 or later Mac model with OS X Yosemite, excluding the Mac Pro (Mid 2012).

To send items to another Mac from your iPhone, you should have:

- MacBook Pro (Late 2008) or later, excluding the MacBook Pro (17-inch, Late 2008)
- MacBook Air (Late 2010) or later
- MacBook (Late 2008) or later, excluding the white MacBook (Late 2008)
- iMac (Early 2009) or later
- Mac Pro (Early 2009 with AirPort Extreme card, or Mid 2010)
- Mac Mini (Mid 2010) or later

Transferring files from iPhone to Mac is pretty simple after turning on AirDrop on both of your devices i.e. iPhone and Mac. The Transferring rate between both the devices is pretty fast using this great feature. Just follow the below given steps:

**Step 1: Turn on AirDrop on iPhone**

**Turn On** the Bluetooth or Wi-Fi as turning them on will **automatically turn on the Airdrop** feature. You can also open the Control Center on your iOs device and run the Airdrop feature. It will ask you a to select a way to be discoverable by others.

**Step 2. Turn on AirDrop on MacBook**

Now Open the Finder window on your Mac, and tap on AirDrop in the menu bar on the left.

**Step 3. AirDrop from iPhone to MacBook**

On your iPhone, you can see the **find a Share** button on your screen. First, choose the files that you want to share photos and videos and after that click on the **Share** **button. **You can share your file by choosing any contact on the AirDrop list.

Also Check: Online Free data storage Sites: Store Data on Cloud

The files that are received via** AirDrop** are automatically stored into your Downloads folder. The downloads folder is in the **Users folder**. You can also find the files with the help of Finder by simply pushing **Option+Command+L**. Here, **AirDrop files** can be recovered by opening the app related to that **file**.

The post How to Airdrop from iPhone to Mac appeared first on Get Program Code.

]]>The post Jingling English Version Software download appeared first on Get Program Code.

]]>Jingling is a software that is used by Chinese webmasters to get traffic or hits on their websites. As, stated above it is a small java app that works as a traffic generator on your blog/site, apart from that it also increases the Alexa Rank too. Jingling English app is very useful and comes handy for those who have a particularly new website as it also improves your search result and views. Webmasters often use the jingling bot official site to increase the profits on PTP or CPM Ad Networks.

Here are some of the advantages that you get using this awesome software:

- No registration is required
- 100% Free
- No setup is required
- Free Support Service
- Provides traffic from different region
- Flexible and easy to use
- Different countries can be selected
- Eastern Time U.S. based Server time
- English version of Traffic Spirit
- Block pop-up ads
- Stops bad script
- Frequent updates
- Professional team

- Download the Jingling from below given links.
- Open the file [no installation required]
- Add your URLs
- Get
**Unlimited free Traffic**on your Site

Thre are many versions of software of this app. Below are the different versions of the software that can be downloaded on your PC/Desktop.

Download the latest version of this app from the below given file. The password for the file is **123456**

To download the English version of this app the below given download link.

The post Jingling English Version Software download appeared first on Get Program Code.

]]>The post Javascript convert string to boolean appeared first on Get Program Code.

]]>So Many people have been asking me for various methods to convert string to **Boolean** in **JS**. Since there isn’t any **built in library function** thus we will explain you the trick to convert string variable to boolean **type**.

So wehave one function Boolean() that returns true for any non empty string. Below is the **syntax** with **example**:

var tempbool = Boolean(“true”); // “true” can also be ‘true’

All the following statements return **true **using **Boolean()** function in **JavaScript**.

var tempbool = Boolean('true'); // returns true var tempbool = Boolean('false'); //also returns true var tempbool = Boolean('anynonemptystring'); // returns true

Thus due to this limitation we have to play it tricky and trust me its damn simple. You first need to **check** the **string** with true or false value using a conditional operator! Confused how? Check below-

**Example:**

var temp = 'true';var tempbool = (temp == 'true'); // read the below explanation before use

Above code returns true to the variable tempbool if **temp **value is equal to **‘true’, **other wise it returns **false**.** **

Do check the live code for better understanding

This is the best way of **converting string to boolean**.

Thanks and do comment your views on this.

The post Javascript convert string to boolean appeared first on Get Program Code.

]]>The post Activation Code for Windows 10 Download Free appeared first on Get Program Code.

]]>We are going to provide you Windows 10 Product Key, Windows 10 Home Product Key, Windows 10 Enterprise Product key and Windows 10 Pro product key. You can find it below:

**Windows 10 Home:**YTMG3-N6DKC-DKB77-7M9GH-8HVX7**Windows 10 Home Country Specific:**N2434-X9D7W-8PF6X-8DV9T-8TYMD**Windows 10 Home Single Language:**BT79Q-G7N6G-PGBYW-4YWX6-6F4BT**Windows 10 Education:**YNMGQ-8RYV3-4PGQ3-C8XTP-7CFBY**Windows 10 Pro:**VK7JG-NPHTM-C97JM-9MPGT-3V66T

- 3PGNV-94VDT-H427D-6HKQB-CWGGC
- 3W63Y-BYNVV-9VP8Q-C97FD-JTYW2
- K6GYQ-NJ873-JCCQ9-TVM7D-WQKTY
- D3KP3-FNC6H-XGFHF-33MXC-RVV3G

- DJW26-YN8CH-2KHXF-RGHKT-8TYQG

- TX9XD-98N7V-6WMQ6-BX7FG-H8Q99
- W269N-WFGWX-YVC9B-4J6C9-T83GX
- MH37W-N47XK-V7XM9-C7227-GCQG9
- DPH2V-TTNVB-4X9Q3-TJR4H-KHJW4
- WNMTR-4C88C-JK8YV-HQ7T2-76DF9

- 8N67H-M3CY9-QT7C4-2TR7M-TXYCV
- TX9XD-98N7V-6WMQ6-BX7FG-H8Q99
- MH37W-N47XK-V7XM9-C7227-GCQG9
- W269N-WFGWX-YVC9B-4J6C9-T83GX
- WNMTR-4C88C-JK8YV-HQ7T2-76DF9
- DPH2V-TTNVB-4X9Q3-TJR4H-KHJW4

- VK7JG-NPHTM-C97JM-9MPGT-3V66T
- W269N-WFGWX-YVC9B-4J6C9-T83GX
- 6P99N-YF42M-TPGBG-9VMJP-YKHCF

- NPPR9-FWDCX-D2C8J-H872K-2YT43
- PBHCJ-Q2NYD-2PX34-T2TD6-233PK
- CKFK9-QNGF2-D34FM-99QX2-8XC4K

- 7HNRX-D7KGG-3K4RQ-4WPJ4-YTDFH

All the above given windows 10 activation key are free to download and are tested by our team. Hope you’ll get the proper key that you needed. These are keys are working with windows 10 ISO.

The post Activation Code for Windows 10 Download Free appeared first on Get Program Code.

]]>The post program for display lower triangular matrix in java appeared first on Get Program Code.

]]>Example:

The matrix contains all the elements above main diagonal is zero, so this matrix

is lower triangular matrix.

import java.util.*; public class LowerTriangularMatrix { public static void main(String args[]) { int arr[][] = new int[10][10]; System.out.println("Enter the order of your Matrics "); System.out.println("Enter the rows:"); Scanner sy = new Scanner(System.in); int n = sy.nextInt(); System.out.println("Enter the columns:"); Scanner s = new Scanner(System.in); int m = s.nextInt(); if(n == m) { System.out.println("Enter your elements:"); for(int i = 0; i < n; i++) { for(int j = 0; j < n; j++) { Scanner sx = new Scanner(System.in); a[i][j] = sx.nextInt(); System.out.print(" "); } } System.out.println("You have entered:"); for(int i=0; i<n; i++) { for(int j=0;j<n;j++) { System.out.print(a[i][j] + " "); } System.out.println(""); } System.out.println("The Lower Triangular Matrix is:"); for(int i=0;i<n;i++) { for(int j=0;j<n;j++) { if(i>=j) { System.out.print(a[i][j] +" "); } else { System.out.print("0"+" "); } } System.out.println(""); } } else { System.out.println("you have entered improper order"); } } }

**Output****:**

Enter the order of your Matrics

Enter the rows:

3

Enter the columns:

3

Enter your elements:

1

2

3

4

5

6

7

8

9

You have entered:

1 2 3

4 5 6

7 8 9

The Lower Triangular Matrix is:

1 0 0

4 5 0

7 8 9

So this was all the complete code for what your were searching –

**How to display Lower triangle matrix in C, JAVA program**

The post program for display lower triangular matrix in java appeared first on Get Program Code.

]]>The post Program to check Pronic number appeared first on Get Program Code.

]]>A Pronic number is a number which is the product of two consecutive integers, that is n*(n+1), Pronic number also express as (n² + n). A Pronic number is also known as oblong number, rectangular number or heteromecic number. There are 99 pronic numbers below 10,000.

**Mathematical Properties****:**

Pronic numbers are even number. Therefore, all pronic numbers are multiples of 2, but 2 is composite number. There are two reasons for pronic number are even.

**1.** If N=i*(i+1), then either i or (i + 1) has to be an even number. Since an even number multiplied by any integer is still an even number, so pronic numbers are even.

**2.** Pronic numbers are twice of triangular numbers. The picture showing 12 is actually 2 × (3 + 2 + 1).

There are no odd pronic number but there is a prime pronic number, the only even prime, 2.

Example:

0, 2, 6, 12, 20, 30, 42, 56, 72, 90, 110, 132, 156…

import java.util.*; class PronicNumber { public static void main(String args[]) { int a, i, j=0 Scanner cy = new Scanner(System.in); System.out.print("Enter a number : "); //get a number to check pronic a = cy.nextInt(); for(i=1; i<=a; i++) { if(i*(i+1) == a) //check number is multiple of two consecutive number or not { j = 1; break; } } if(j == 1) //print number is pronic or not System.out.println(a+" is a Pronic Number."); else System.out.println(a+" is not a Pronic Number."); } }

Output:

Enter a number: 72

72 is a Pronic Number.

Enter a number: 112

112 is not a Pronic Number.

Enter a number : 110

110 is a Pronic Number.

Enter a number : 73

73 is not a Pronic Number.

**Pronic number code in Java, BlueJ, C**

The post Program to check Pronic number appeared first on Get Program Code.

]]>