Posts

Showing posts from October, 2019

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");   scanf("%d", &n);   printf("Enter %d integers\n&

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; }

Important c programming codes

Image
Check vowel #include < stdio.h > int main() { char ch; printf("Input a character\n"); scanf("%c", &ch); switch(ch) { case 'a': case 'A': case 'e': case 'E': case 'i': case 'I': case 'o': case 'O': case 'u': case 'U': printf("%c is a vowel.\n", ch); break; /*if ch matches any case then it prints & breaks the execution */ default: printf("%c is not a vowel.\n", ch); /*if the ch is not from the cases then prints ch is not a vowel */ } return 0; } Leap year #include < stdio.h > int main() { int year; printf("Enter a year to check if it is a leap year\n"); scanf("%d", &year); if ( year%400 == 0) printf("%d is a leap year.\n", year); else if ( year%100 == 0) printf("%d is not a leap year.\n", year); else if ( year%4 == 0 ) printf("%d is a leap year.\n"

Area and volume related c programming codes

Image
Area of triangle #include < stdio.h > void main() { int height, base; float ans; printf("Enter height and base"); scanf("%d %d",&height, &base); ans= (1/2)*height*base; printf("Area if triangle is %f",ans); } Area of Circle #include < stdio.h > #include < math.h > #define PI 3.142 void main() { float radius, area; printf("Enter the radius of a circle \n"); scanf("%f", &radius); area = PI * pow(radius, 2); printf("Area of a circle = %5.2f\n", area); } Area of Rectangle #include < stdio.h > #include < conio.h > int main() { int length, breadth, area; printf("\nEnter the Length of Rectangle : "); scanf("%d", &length); printf("\nEnter the Breadth of Rectangle : "); scanf("%d", &breadth); area = length * breadth; printf("\nArea of Rectangle : %d", area); return (0); } Area of Square

Random c programming coding

Image
Odd or Even #include < stdio.h > main() { int n; printf("Enter an integer\n"); scanf("%d",&n); if ( n%2 == 0 ) printf("Even\n"); else printf("Odd\n"); return 0; } Greatest of 3 numbers #include < stdio.h > void main() { int a,b,c; printf("enter any three numbers:\n"); scanf("%d%d%d",&a, &b, &c); if(a>b&&a>c) printf("greatest number is: %d",a); else if(b>c) printf("greatest number is: %d",b); else printf("greatest number is: %d",c); } Swapping two numbers #include < stdio.h > int main() { int x, y, temp; printf("Enter the value of x and y\n"); scanf("%d%d", &x, &y); printf("Before Swapping\nx = %d\ny = %d\n",x,y); temp = x; x = y; y = temp; printf("After Swapping\nx = %d\ny = %d\n",x,y); return 0; } Nested If Else #include < stdio.h > vo

Things You Must Know Before Trying C Programming

The C programming language is a general-purpose, high-level language (generally denoted as structured language). C programming language was at first developed by Dennis M. Ritchie at At&T Bell Labs. C is one of the most commonly used programming languages. It is simple and efficient therefore it become best among all. It is used in all extents of application, mainly in the software development. Many software's & applications as well as the compilers for other programming languages are written in C also Operating Systems like Unix, DOS and Windows are written in C. C has many powers, it is simple, stretchy and portable, and it can control System Hardware easily. It is also one of the few languages to have an international standard, ANSI C.  Advantages of C - Fast, Powerful & efficient - Easy to learn. - It is portable - ''Mid-level'' Language - Widely accepted language - Supports modular programming style - Useful for all applic

Five Features Of C Programming Example Programs That Make Everyone Love It.

 Advantages of C - Fast, Powerful & efficient - Easy to learn. - It is portable - ''Mid-level'' Language - Widely accepted language - Supports modular programming style - Useful for all applications - C is the native language of UNIX - Easy to connect with system devices/assembly routines Print Integer #include < stdio.h > int main() { int a; printf("Enter an integer\n"); scanf("%d", &a); //takes an integer from user printf("Integer that you have entered is %d\n", a); return 0; } Addition of two no #include < stdio.h > int main() { int first, second, sum; printf("Enter two integers to add\n"); scanf("%d%d", &first, &second); sum = first + second ; /*Adding contents of first and second and storing in sum*/ printf("Sum of entered numbers = %d\n",sum); return 0; } Add subtract multiply divide #include < stdio.h > int main() { int

Things You Probably Didn't Know About Loses In Optical Fibre

There is some types of losses in Optical fibre.. What is Attenuation? Attenuation is the loss of light energy as the light pulse travels from one end of the cable to the other end. It is called as signal loss or fibre loss. It also decides the number of repeaters required between transmitter and receiver. Attention is directly proportional to the length of cable. α= 10 log10(Pi/Po) [in db/Km] where, Pi = Input power Po= Output power α= Attenuation constant The various losses are: Absorption loss Scattering loss Dispersion loss Bending loss Absorption loss: Absorption of light energy due to heat of ion impurities results in dimming of light at the end of fibre. 1.  Intrinsic absorption : It is caused by the interaction with one or more components of glass. It occurs when photon interacts with an electron in the valance band and excites it to a higher energy level. 2.  Extrinsic Absorption : It is also called impurity absorption. Resu

All You Need To Know About Is Optical Fibre Good Or Bad.

Image
Redusedcal fibre is an example of guided media or connection oriented media. It is suitable for long distance communication. Let's discuss about it. Optical fibre basic features : Transmission of signal is in optical form. It is made of glass or plastics. Efficiency high. Bandwidth very high. Diameter small. Noise immunity high. Highly expensive. Weight light Transmission speed is high. A pplication : 1. Medical : It is used as light guides, imaging tools and also as lasers for surgeries. 2. Telecommunication : Fiber is used for transmitting and receiving purpose. 3. Data storage : It is used for data transmission. Special properties of Optical fibre : 1. Optical fibre transmits a signal encoded beam of light by means of total internal reflection. Lets discuss what is Total Internal Reflection?? When the incident angle is greater than the critical angle, the light is reflected back to medium 1. There will not be any light transmission in medium 2.

What You Know About Transmission Media And What You Don't Know About Transmission Media

Image
Transmission Media is defined as through which information is carried from source to destination. These transmission media can be connection oriented or connection less. There are two types of transmission media: Guided media(Connection oriented) Unguided media(Connection less) Guided Media: Guided media are those that provide a conductor from one device to the other. Signal requires a physical path for transmission. It is called wired communication. It provides direction to signal for travelling. Example : Twisted pair cable, Coaxial cable, Optical fibre Cable, Hub. Unguided Media: Unguided media are those transport electromagnetic waves without the use of physical conductor. They are wireless. Signal is broadcasted through air or sometimes water. It does not provide any direction. Example : Radio wave, Micro wave. F eatures of Connection oriented communication : Connection is necessary. It is used for connection establishment. It can be used u

Five New Thoughts About Basics Of Communication System That Will Turn Your World Upside Down

Image
Definition of network : A network is a set of devices/nodes connected by media links. Media means communication channels. These devices may be computer, mobile, printer etc. Let's try to understand through the following figure given below : A im of data communication : The aim is to exchange data such as text, audio/video from one point to another point. Basic communication Model: Computer network criteria: 1. Performance : Response Time is the time between the end of a research and the beginning of a response. Request a file transfer and start the file transfer. Factors that affect Response Time are: Number of Users: More users on a network slow the connection. Transmission Speed: Transmission speed is that data will be transmitted. It is measured in bits per second (bps). Media Type: Media is the connection between two nodes. It can be different types. Hardware Type: Slow computers such as XT or fast such as Pentiums. Software Program: How good