+int main()
+ {
+ int m, n, p, q, c, d, k, sum = 0;
+ int first[10][10], second[10][10], multiply[10][10];
+
+ printf("Enter number of rows and columns of first matrix\n");
+ scanf("%d%d", &m, &n);
+
+ printf("Enter elements of first matrix\n");
+
+ for (c = 0; c < m; c++)
+ for (d = 0; d < n; d++)
+ scanf("%d", &first[c][d]);
+
+ printf("Enter number of rows and columns of second matrix\n");
+ scanf("%d%d", &p, &q);
+
+ if (n != p)
+ printf("The matrices can't be multiplied with each other.\n");
+
+ else
+ {
+ printf("Enter elements of second matrix\n");
+
+for (c=0;c
+#include
+
+int main(){
+ char string1[20];
+ int i, length;
+ int flag = 0;
+
+ printf("Enter a string:");
+ scanf("%s", string1);
+
+ length = strlen(string1);
+
+ for(i=0;i < length ;i++){
+ if(string1[i] != string1[length-i-1]){
+ flag = 1;
+ break;
+ }
+}
+
+ if (flag) {
+ printf("%s is not a palindrome\n", string1);
+ }
+ else {
+ printf("%s is a palindrome\n", string1);
+ }
+ return 0;
+}
+```
+
+---
+### 25) Program to perform basic operations like lenghth of string, string concat, string copy, string compare and string reverse.
+```C
+/*Fundamental string operation, lenth, concatenation, compare and copy strings without string.h */
+
+#include
+#include
+
+int find_length(char string[]) {
+ int len = 0, i;
+ for (i = 0; string[i] != '\0'; i++) {
+ len++;
+ }
+ return len;
+ }
+
+void join_strings(char string1[], char string2[]) {
+ int i, len1, len2;
+ len1 = find_length(string1);
+ len2 = find_length(string2);
+ for (i = len1; i < len1 + len2; i++) {
+ string1[i] = string2[i - len1];
+ }
+ string1[i] = '\0'; //adding null character at the end of input
+}
+/*returns 0 if thery are same otherwise returns 1*/
+
+int compare_strings(char string1[], char string2[]) {
+ int len1, len2, i, count = 0;
+ len1 = find_length(string1);
+ len2 = find_length(string2);
+ if (len1 != len2)
+ return 1;
+ for (i = 0; i < len1; i++) {
+ if (string1[i] == string2[i])
+ count++;
+ }
+ if (count == len1)
+ return 0;
+ return 1;
+}
+
+void copy_string(char destination[], char source[]) {
+ int len, i;
+ len = find_length(source);
+ for (i = 0; i < len; i++) {
+ destination[i] = source[i];
+ }
+ destination[i] = '\0';
+}
+
+int main() {
+ char string1[20], string2[20]; //string variables declaration with size 20
+ int choice;
+ while (1) {
+ printf("\n1. Find Length \n2. Concatenate \n3. Compare \n4. Copy \n5. Exit\n");
+ printf("Enter your choice: ");
+ scanf("%d", & choice);
+ switch (choice) {
+ case 1:
+ printf("Enter the string: ");
+ scanf("%s", string1);
+ printf("The length of string is %d", find_length(string1));
+ break;
+ case 2:
+ printf("Enter two strings: ");
+ scanf("%s%s", string1, string2);
+ join_strings(string1, string2);
+ printf("The concatenated string is %s", string1);
+ break;
+ case 3:
+ printf("Enter two strings: ");
+ scanf("%s%s", string1, string2);
+ if (compare_strings(string1, string2) == 0) {
+ printf("They are equal");
+ } else {
+ printf("They are not equal");
+ }
+ break;
+ case 4:
+ printf("Enter a string: ");
+ scanf("%s", string1);
+ printf("String1 = %s\n");
+ printf("After copying string1 to string 2\n");
+ copy_string(string2, string1);
+ printf("String2 = %s", string2);
+ break;
+ case 5:
+ exit(0);
+ }
+ }
+ return 0;
+}
+```
+
+
+
+---
+### 26) Programs to swap two numbers using call by value and call by refernce.
+#### Call by reference
+```C
+/* Call by reference */
+
+#include
+void swap(int*, int*);
+
+int main() {
+
+ int x, y;
+
+ printf("Enter the value of x and y\n");
+ scanf("%d%d",&x,&y);
+
+ printf("Before Swapping\nx = %d\ny = %d\n", x, y);
+
+ swap(&x, &y);
+
+ printf("After Swapping\nx = %d\ny = %d\n", x, y);
+
+ return 0;
+}
+
+void swap(int *a, int *b)
+{
+ int temp;
+
+ temp = *b;
+ *b = *a;
+ *a = temp;
+}
+```
+
+#### call by value
+```C
+/* Call by value */
+
+#include
+
+void swap(int, int);
+
+int main() {
+
+ int x, y;
+
+ printf("Enter the value of x and y\n");
+ scanf("%d%d",&x,&y);
+
+ printf("Before Swapping\nx = %d\ny = %d\n", x, y);
+
+ swap(x, y);
+
+ printf("After Swapping\nx = %d\ny = %d\n", x, y);
+
+ return 0;
+}
+
+void swap(int a, int b) {
+ int temp;
+
+ temp = b;
+ b = a;
+ a = temp;
+ printf("Values of a and b is %d %d\n",a,b);
+}
+```
+
+---
+### 27) Program to calculate factorial of a number with and without recursion both.
+```C
+/* With Recursion */
+
+#include
+long int multiplyNumbers(int n);
+int main() {
+
+int n;
+ printf("Enter a positive integer: ");
+ scanf("%d", &n);
+ printf("Factorial of %d = %ld\n", n, multiplyNumbers(n));
+ return 0;
+}
+long int multiplyNumbers(int n)
+{
+ if (n >= 1)
+ return n*multiplyNumbers(n-1);
+ else
+ return 1;
+}
+```
+
+
+```C
+/* Without recursion: */
+
+#include
+
+int main() {
+
+ int c, n, fact = 1;
+
+ printf("Enter a number to calculate its factorial\n");
+ scanf("%d", &n);
+
+ for (c = 1; c <= n; c++)
+ fact = fact * c;
+
+ printf("Factorial of %d = %d\n", n, fact);
+
+ return 0;
+}
+```
+
+---
+### 28) Program to print fibonacci series with and without recursion both.
+```C
+/* with recursion */
+
+#include
+void series(int);
+
+int main() {
+
+ int n;
+
+printf("\n\nEnter the number of terms you wish");
+ scanf("%d",&n);
+ printf("\n\n");
+
+ series(n);
+ printf("\n\n\n");
+
+ return 0;
+}
+
+void series(int n)
+
+{
+ int t1=0,t2=1,next;
+
+ for(int i=0;i<=n;i++)
+ {
+ printf("%d\t",t1);
+
+ next=t1+t2;
+ t1=t2;
+ t2=next;
+ }
+}
+```
+
+
+```C
+/* without recursion */
+#include
+int main()
+{
+ int n1=0,n2=1,n3,i,number;
+ printf("Enter the number of elements:");
+ scanf("%d",&number);
+ printf("\n%d %d\n",n1,n2);
+ for(i=2;i
+int avg(int,int,int,int,int);
+
+int main() { int a1,a2,a3,a4,a5,res;
+
+ printf("\nEnter the numbers respectiively: ");
+ scanf("%d%d%d%d%d",&a1,&a2,&a3,&a4,&a5);
+
+ res=avg(a1,a2,a3,a4,a5);
+ printf("Average of the numbers is %d\n",res);
+
+ return 0;
+ }
+
+ int avg(int a1,int a2,int a3,int a4,int a5)
+
+ { int p;
+ p=(a1+a2+a3+a4+a5)/5;
+ return p;
+ }
+ ```
+
+---
+### 30) Program to implement linear serach and binary.
+```C
+/* Linear Search */
+#include
+
+int main()
+{
+ int array[100], search, c, n;
+
+ printf("Enter number of elements in array\n");
+ scanf("%d", &n);
+
+ printf("Enter %d integer(s)\n", n);
+
+ for (c = 0; c < n; c++)
+ scanf("%d", &array[c]);
+
+ printf("Enter a number to search\n");
+ scanf("%d", &search);
+
+ for (c = 0; c < n; c++)
+ {
+ if (array[c] == search)
+ {
+ printf("%d is present at location %d.\n", search, c+1);
+ break;
+ }
+ }
+ if (c == n)
+ printf("%d isn't present in the array.\n", search);
+
+ return 0;
+}
+```
+
+```C
+/* Binary Search */
+
+#include
+
+int main()
+{
+ int c, first, last, middle, n, search, array[100];
+
+ printf("Enter number of elements\n");
+ scanf("%d",&n);
+
+ printf("Enter %d integers\n", n);
+
+ for (c = 0; c < n; c++)
+ scanf("%d",&array[c]);
+
+ printf("Enter value to find\n");
+ scanf("%d", &search);
+
+ first = 0;
+ last = n - 1;
+ middle = (first+last)/2;
+
+ while (first <= last) {
+ if (array[middle] < search)
+ first = middle + 1;
+ else if (array[middle] == search) {
+ printf("%d found at location %d.\n", search, middle+1);
+ break;
+ }
+ else
+ last = middle - 1;
+
+ middle = (first + last)/2;
+ }
+ if (first > last)
+ printf("Not found! %d isn't present in the list.\n", search);
+
+ return 0;
+}
+```
+
+---
+### 31) Program to implement bubble sort.
+```C
+#include
+
+int main()
+{
+ int array[100], n, c, d, swap;
+
+ printf("Enter number of elements\n");
+ scanf("%d", &n);
+
+ printf("Enter %d integers\n", n);
+
+ for (c = 0; c < n; c++)
+ scanf("%d", &array[c]);
+
+ for (c = 0 ; c < n - 1; c++)
+ {
+ for (d = 0 ; d < n - c - 1; d++)
+ {
+ if (array[d] > array[d+1])
+ {
+ swap = array[d];
+ array[d] = array[d+1];
+ array[d+1] = swap;
+ }
+ }
+ }
+
+ printf("Sorted list in ascending order:\n");
+
+ for (c = 0; c < n; c++)
+ printf("%d\n", array[c]);
+
+ return 0;
+}
+```
+
+---
+### 32) Program to store information of 10 students using array of structures.
+```C
+/* Structures for student */
+
+#include
+struct student
+{
+ char name[50];
+ int roll;
+ float marks;
+} s[10];
+int main()
+{
+ int i;
+ printf("Enter information of students:\n");
+ for(i=0; i<3; ++i)
+ {
+ s[i].roll = i+1;
+ printf("\nFor roll number%d,\n",s[i].roll);
+ printf("Enter name: ");
+ scanf("%s",s[i].name);
+ printf("Enter marks: ");
+ scanf("%f",&s[i].marks);
+ printf("\n");
+ }
+ printf("Displaying Information:\n\n");
+ for(i=0; i<3; ++i)
+ {
+ printf("\nRoll number: %d\n",i+1);
+ printf("Name: ");
+ puts(s[i].name);
+ printf("Marks: %.1f",s[i].marks);
+ printf("\n");
+ }
+ return 0;
+}
+```
+
+---
+### 33) Programs to compute the transpose of a matrix.
+```C
+#include
+int main()
+{
+ int a[10][10], transpose[10][10], r, c, i, j;
+ printf("Enter rows and columns of matrix: ");
+ scanf("%d %d", &r, &c);
+
+ printf("\nEnter elements of matrix:\n");
+ for(i=0; i
+int main() {
+ int a;
+ int *pt;
+
+ a = 10;
+ pt = &a;
+
+ printf("\n[&a ]:Address of A = %p", &a);
+
+
+ return 0;
+}
+
+```
+
+---
+### 35) Program to access array using pointer.
+```C
+#include
+int main()
+{
+ int data[5], i;
+ printf("Enter elements: ");
+ for(i = 0; i < 5; ++i)
+ scanf("%d", data + i);
+ printf("You entered: \n");
+ for(i = 0; i < 5; ++i)
+ printf("%d\n", *(data + i));
+ return 0;
+}
+```
+
\ No newline at end of file
diff --git a/README.md b/README.md
index ca04a7d..50a098b 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,2 @@
# PPS
Programming for Problem Solving
-
-Follow instructions give in README.md file, found in respective folder.