Posts

Basic algebra formulas that you can revise anytime and anywhere

FORMULAS FOR BEGINNER (a+b) ^2= a^2+b^2+2ab (a+b) ^2= (a-b) ^2+4ab (a-b) ^2= a^2+b^2-2ab (a-b) ^2= (a+b) ^2-4ab a^2+b^2= (a+b) ^2-2ab a^2+b^2= (a-b) ^2+ 2ab a^2-b^2= (a+b) (a-b) (a+b+c) ^2= a^2+b^2+c^2+2(ab+bc+ac) (a-b-c) ^2= a^2+b^2+c^2-2(ab-bc+ac) (a+b) ^3= a^3+b^3+3ab(a+b) (a-b) ^3= a^3-b^3+3ab(a-b) a^3+b^3= (a+b) (a^2-ab+b^2) a^3-b^3= (a-b) (a^2+ab+b^2) a^4-b^4= (a^2-b^2) (a^2+b^2) = (a^2+b^2) (a+b) (a-b) a^5+b^5= (a+b) (a^4-a^3b+a^2b^2-ab^3+b^4) a^5-b^5= (a-b) (a^4+a^3b+a^2b^2+ab^3+b^4)

Basics of digital image processing

Image
What is digital image processing ???? Image processing is a method to perform some Operations on an image.  In order to get an enhanced image means extract some useful information from the image.  It is a type of signal processing. In this input is an image and output may be image or characteristics of features associated with the image.  Applications: Some of the major fields in which digital image processing is widely used as mentioned below : Image sharpening and restoration  Medical field  Remote sensing Transmission and encoding Video processing  Colour processing  Microscopic imaging Machine vision Robot vision Pattern recognition  These are the Concept of Digital image processing ... We'll be glad if you share your valuable information with us regarding this topic, then it will be a golden oppertunity for all of us to improve ourselves and know more. Comment below!!

Sort related programming

Bubble sort #include < stdio.h > void bubble_sort(long [], long); int main() {   long array[100], n, c, d, swap;   printf("Enter number of elements\n");   scanf("%ld", &n);   printf("Enter %ld integers\n", n);   for (c = 0; c < n; c++)   scanf("%ld", &array[c]);   bubble_sort(array, n);   printf("Sorted list in ascending order:\n");   for ( c = 0 ; c < n ; c++ )   printf("%ld\n", array[c]);   return 0; } void bubble_sort(long list[], long n) {   long c, d, t;   for (c = 0 ; c < ( n - 1 ); c++)   {   for (d = 0 ; d < n - c - 1; d++)   {   if (list[d] > list[d+1])   {   t = list[d];   list[d] = list[d+1];   list[d+1] = t;   }   }   } } Insertion sort #include < stdio.h > int main() {   int n, array[1000], c, d, t;   printf("Enter number of elements\n");   scan...

Matrices related codes

Add matrices #include < stdio.h > int main() { int m, n, c, d, first[10][10], second[10][10], sum[10][10]; printf("Enter the number of rows and columns of matrix\n"); scanf("%d%d", &m, &n); printf("Enter the elements of first matrix\n"); for ( c = 0 ; c < m ; c++ ) for ( d = 0 ; d < n ; d++ ) scanf("%d", &first[c][d]); printf("Enter the elements of second matrix\n"); for ( c = 0 ; c < m ; c++ ) for ( d = 0 ; d < n ; d++ ) scanf("%d", &second[c][d]); for ( c = 0 ; c < m ; c++ ) for ( d = 0 ; d < n ; d++ ) sum[c][d] = first[c][d] + second[c][d]; printf("Sum of entered matrices:-\n"); for ( c = 0 ; c < m ; c++ ) { for ( d = 0 ; d < n ; d++ ) printf("%d\t", sum[c][d]); printf("\n"); } return 0; } Subtract matrices #include < stdio.h > int main() { int m, n, c, d, first[10][10], second[10][10], difference[10][10]; ...

Array related codes

Reverse array #include < stdio.h > int main() { int n, c, d, a[100], b[100]; printf("Enter the number of elements in array\n"); scanf("%d", &n); printf("Enter the array elements\n"); for (c = 0; c < n ; c++) scanf("%d", &a[c]); for (c = n - 1, d = 0; c >= 0; c--, d++) b[d] = a[c]; for (c = 0; c < n; c++) a[c] = b[c]; printf("Reverse array is\n"); for (c = 0; c < n; c++) printf("%d\n", a[c]); return 0; } Maximum element in array #include < stdio.h > int main() { int array[100], maximum, size, c, location = 1; printf("Enter the number of elements in array\n"); scanf("%d", &size); printf("Enter %d integers\n", size); for (c = 0; c < size; c++) scanf("%d", &array[c]); maximum = array[0]; for (c = 1; c < size; c++) { if (array[c] > maximum) { maximum = array[c]; location = c+1; } } printf("Maximu...

Conversion related codes

Image
Decimal to binary bitwise #include < stdio.h > int main() { int n, c, k; printf("Enter an integer in decimal number system\n"); scanf("%d", &n); printf("%d in binary number system is:\n", n); for (c = 31; c >= 0; c--) { k = n >> c; if (k & 1)//k is logically ANDed with 1 printf("1"); else printf("0"); } return 0; } Decimal to Binary #include < stdio.h> void main() { long num, decimal_num, remainder, base = 1, binary = 0; printf("Enter a decimal integer \n"); scanf("%ld", & num); decimal_num = num; while (num > 0) { remainder = num % 2; binary = binary + remainder * base; num = num / 2; base = base * 10; } printf("Input number is = %d\n", decimal_num); printf("Its binary equivalent is = %ld\n", binary); } Decimal to Octal #include void main() { long num, decimal_num, remainder, base = 1, octal = 0; print...

Pattern related coding

Image
Print Pattern #include < stdio.h > int main() { int row, c, n, temp; printf("Enter the number of rows in pyramid of stars you wish to see "); scanf("%d",&n); temp = n; for ( row = 1 ; row <= n ; row++ ) { for ( c = 1 ; c < temp ; c++ ) printf(" "); temp--; for ( c = 1 ; c <= 2*row - 1 ; c++ ) printf("*"); printf("\n"); } return 0; } Diamond pattern #include < stdio.h > int main() { int n, c, k, space = 1; printf("Enter number of rows\n"); scanf("%d", &n); space = n - 1; for (k = 1; k <= n; k++) { for (c = 1; c <= space; c++) printf(" "); space--; for (c = 1; c <= 2*k-1; c++) printf("*"); printf("\n"); } space = 1; for (k = 1; k <= n - 1; k++) { for (c = 1; c <= space; c++) printf(" "); space++; for (c = 1 ; c <= 2*(n-k)-1; c++) printf("*"); printf("\n"); } ...

Important c programming codes

Image
Find armstrong number #include < stdio.h > int main() { int number, sum = 0, temp, remainder; printf("Enter an integer\n"); scanf("%d",&number); temp = number; while( temp != 0 ) { remainder = temp%10; sum = sum + remainder*remainder*remainder; temp = temp/10; } if ( number == sum ) printf("Entered number is an armstrong number.\n"); else printf("Entered number is not an armstrong number.\n"); return 0; } Generate armstrong number #include < stdio.h > int main() { int r; long number = 0, c, sum = 0, temp; printf("Enter an integer upto which you want to find armstrong numbers\n"); scanf("%ld",&number); printf("Following armstrong numbers are found from 1 to %ld\n",number); for( c = 1 ; c < = number ; c++ ) { temp = c; while( temp != 0 ) { r = temp%10; sum = sum + r*r*r; temp = temp/10; } if ( c == sum ) printf("%ld\n", c); sum = 0; } ...