Taylor and Maclaurin Series

Lets try with Taylor and Maclaurin Series. We start by supposing that ƒ is any function that can be represented by a power series: Let’s try to determine what the coefficients cn must be in terms of ƒ. To begin, notice that if we put x = a in Equation 1, then all terms after the first one are 0 and we get ƒ(a) = c0 If we differentiate the series in equation 1 term by term... Here we just convert the degree in radian as we know that 1800 = πc And the substitution of x = a in equation 2 ƒ'(a) = c1 Now we differentiate both sides...

C program For Trigonometric ratio.

Lets try with the library function to calculate the trigonometric ratio. Here use the built in function. The C library function double cos(double x) returns the cosine of a radian angle x. Correspondingly the sin(x) and tan(x) Here we just convert the degree in radian using 1800 = πc (Radian) // Using Library function #include<stdio.h> void main(){ float tempt, degree; printf("Enter the number \(In degree\)\n"); scanf("%f",&degree); tempt = degree; degree = degree * 3.14159265359 / 180; printf("sin\(%.2f\)...

1's and 2's complement

1’s Complements: Just replaces each one with ‘0’ and each zero with ‘1’. For example: 100101 it’s 1’s complement is 011010 2’s Complements: When we add an extra one with the 1’s complements of a number we will get the 2’s complements. For example: 100101 it’s 1’s complement is 011010 and 2’s complement is 011010+1 = 011011 (By adding one with 1's complement) Why we need the complements of a number One reason of it is to represent the negative number. In binary system we use ‘1’ for negative number and ‘0’ for positive number. We...

C program for Bitwise Operation.

To know more about Bitwise operation please read the Bitwise Operator in C. It explains how these bitwise operator work in C #include <stdio.h> void main(void) { int i=165,j=281; printf("Bitwise AND operation of %d and %d is %d \n", i,j, i&j); printf("Bitwise OR operation of %d and %d is %d \n", i,j, i|j); printf("Bitwise XOR operation of %d and %d is %d \n", i,j, i^j); printf("2 bits right shift of %d is %d \n", i, i>>2 ); printf("3 bits left shift of %d is %d \n", i, i<<3); printf("NOT operation of %d is %d \n", i, ~i); } ...

Bitwise Operator in C

In the C programming language, operations can be performed on a bit level using bitwise operators. Following are the six bitwise operators provided by C for bit manipulation Symbol Operator & bitwise AND | bitwise inclusive OR ^ bitwise exclusive OR << left shift >> right shift ~ bitwise NOT (one's complement) (unary) To understand these operation lets ahead with two example.. We know that in C, integer consumed 2 bytes or 16 bit memory. So the binary representation of 165 and 281 as the following...

C program and flowchart to find the largest of three numbers

Following is the flowchart to find out the largest of three number And following is the C code #include <stdio.h> void main(void) { int A,B,C; printf("Enter 3 integer number \n"); scanf("%d",&A); scanf("%d",&B); scanf("%d",&C); if(A>B){ if(A>C){ printf(" %d is the Greatest Number \n",A); } else{ printf("%d is the greatest Number \n",C); } } else{ if(B>C){ printf("%d is the greatest Number...

To check if it is Leap Year with C

#include <stdio.h> void main(void) { int year; printf("Enter a year to check if it is Leap Year\n"); scanf("%d",&year); if(year%400==0) /* Why mod 400 */ printf("%d is a Leap Year\n",year); else if(year%100==0) /* Why mod 100 */ printf("%d is not a Leap Year\n",year); else if(year%4==0) printf("%d is a Leap Year\n",year); else printf("%d is not a Leap Year\n",year); } ...

The reason for leap year

Who invented Leap Years? Julius Caesar introduced Leap Years in the Roman empire over 2000 years ago, but the Julian calendar had only one rule: any year evenly divisible by 4 would be a leap year. This led to way too many leap years, but didn't get corrected until the introduction of the Gregorian Calendar more than 1500 years later. Which Years are Leap Years? In the Gregorian calendar 3 criteria must be taken into account to identify leap years: The year is evenly divisible by 4; If the year can be evenly divided by 100, it is...

What is Modulo operation?

In computing, the modulo operation finds the remainder of division of one number by another (sometimes called modulus). Given two positive numbers, a (the dividend) and n (the divisor), a modulo n (abbreviated as a mod n) is the remainder of the division of a by n . For instance, the expression "5 mod 2" would evaluate to 1 because 5 divided by 2 leaves a quotient of 2 and a remainder of 1. While "9 mod 3" would evaluate to 0 because the division of 9 by 3, has a quotient of 3 and leaves a remainder of 0; there is nothing to subtract...

Find out Odd and Even number using C

C program tofind out odd or even number using modulus operator #include <stdio.h> void main(void) { int i; printf("Enter an integer\n"); scanf("%d",&i); if(i%2==0)/* Modulo operator Here it produce 0 for every even Number */ { printf("This is an even number.\n"); } else { printf("This is an odd Number\n"); } ...