Saturday, 10 December 2016

Sum of N No. of NATURAL Number - C Programming Examples

We have started C Programming coding with Example Series, We have published in previous post about Fibonacci , Arithmetic , Geometric And Harmonic Series.Now we are going to Explore new segment about Special Series and Sequences.

We have chosen to start with Natural Numbers and in this post you will find some basic idea and some useful concepts about Natural Numbers .In this post we are writing a C program for Finding SUM of N Natural Numbers in TURBO C/C++ Application Software / Compiler .You can download C Codes below.Please let us know your feedback.



SUM OF N NATURAL NUMBERS Video Tutorial(See C- Codes Below ):




Natural Numbers Explained:-
In mathematics, the natural numbers are those used for counting (as in "there are six coins on the table") and ordering (as in "this is the third largest city in the country"). In common language, words used for counting are "cardinal numbers" and words used for ordering are "ordinal numbers".

The sum of the first n natural numbers, Sn, is:


Some authors and ISO 31-11 begin the natural numbers with 0, corresponding to the non-negative integers 0, 1, 2, 3, …, whereas others start with 1, corresponding to the positive integers 1, 2, 3, …

Tuesday, 23 August 2016

Fibonacci Series Using Array And For Loop - C Programming Examples

Fibonacci Series Using Array
As we have started C Programming coding with Example Series, We have published last posts
"Write A Program For SUM of Infinite HP"

"Write A Program To Find SUM of AP" and

"Write A Program To Find SUM of GP Sequence".

We have chosen to start with Arithmetic Series and in this post you will find some basic idea and some useful concepts about Fibonacci Numbers .You can download C Codes below.Please let us know your feedback.

In this post we are doing again Fibonacci Series but with different approach.In last post "Fibonacci Progression Using While Loop" you will see how to generate Fibonacci Numbers by using concepts of  Do-While Loop.In this post we will talk about another loop i.e. For Loop and side by side Concept of Arrays will be discussed and demonstrated.

Fibonacci Series - Sequence ( Using Array And For Loop ) Video Tutorial(See C- Codes Below ):


For Loop Concept: FOR Loops are the most useful type. The syntax for a for loop is 
for ( variable initialisation; condition; variable update ) {
  Code to execute while the condition is true
}

A working Example of FOR Loop
Example:

#include <stdio.h>

int main()
{
    int x;
    /* The loop goes while x < 10, and x increases by one every loop*/
    for ( x = 0; x < 10; x++ )
{
        /* Keep in mind that the loop condition checks 
           the conditional statement before it loops again.*/   
        printf( "%d\n", x );
    }
    getchar();
}

Array Concept: Arrays may be defined as a kind of data structure that can store a fixed-size sequential collection of elements of the same type.An array is used to store a collection of data, but it is often more useful to think of an array as a collection of variables of the same type.

Arrays are of two types:
A. One-dimensional arrays
B. Multidimensional arrays

Tuesday, 24 May 2016

Fibonacci Numbers Series Progression Using While Loop - C Programming Examples

Fibonacci Numbers Programming
As we have started C Programming coding with Example Series, We have published last posts
"Write A Program For SUM of Infinite HP"
"Write A Program To Find SUM of AP" and
"Write A Program To Find SUM of GP Sequence".
We have chosen to start with Arithmetic Series and in this post you will find some basic idea and some useful concepts about Fibonacci Numbers .You can download C Codes below.Please let us know your feedback.

Fibonacci Numbers Progression - Series - Sequence to Nth Term Step-wise Video Tutorial(See C- Codes Below ):

Fibonacci Sequence:-The Fibonacci Sequence is the series of numbers:
0, 1, 1, 2, 3, 5, 8, 13, 21, 34, ...The next number is found by adding up the two numbers before it.

The 2 is found by adding the two numbers before it (1+1).Similarly, the 3 is found by adding the two numbers before it (1+2),And the 5 is (2+3),and so on!

Saturday, 9 January 2016

Harmonic Progression-Write A Program To Find SUM of Infinite HP.- C Programming Examples

As we have started C Programming coding with Example Series, We have published last posts "Write A Program To Find SUM of AP" and "Write A Program To Find SUM of GP Sequence". We have chosen to start with mathematical series and in this post you will find some basic idea and some useful concepts about Harmonic Progression (H.P.).You can download C Codes below.Please let us know your feedback.

Suggested Reading:
Common C Questions :TURBO C/C++
Integrated Environment : TURBO C/C++ - Getting Started
TURBO C/C++: Installer and Installation
C Language Programming With Examples-INDEX

Harmonic Progression/Sequence Step-wise Video Tutorial(See C- Codes Below ):

In mathematics, a Harmonic Progression (or harmonic sequence) is a progression formed by taking the reciprocals of an arithmetic progression. In other words, it is a sequence of the form. 
where −a/d is not a natural number and k is a natural number.

Equivalently, a sequence is a harmonic progression when each term is the harmonic mean of the neighboring terms.It is not possible for a harmonic progression (other than the trivial case where a = 1 and k = 0) to sum to an integer. The reason is that, necessarily, at least one denominator of the progression will be divisible by a prime number that does not divide any other denominator.

A general H.P. is 1/a + 1/(a + d) + 1(a + 2d) + ...

nth term of an H.P. = 1/[a +(n -1)d]

Saturday, 26 December 2015

Geometric Progression - Write A Program To Find SUM of GP Sequence -C Programming Examples

Geometric Progression Programming In C IngenuityDias
As we have started C Programming coding with Example Series, We have published last post Write A Program To Find SUM of AP. We have chosen to start with mathematical series and in this post you will find some basic idea and some useful concepts about Geometric Progression (G.P.).You can download C Codes below.Please let us know your feedback.

Suggested Reading:
Integrated Environment : TURBO C/C++ - Getting Started
TURBO C/C++: Installer and Installation
C Language Programming With Examples-INDEX

Arithmetic Progression Step-wise Video Tutorial(See C- Codes Below ):


      


Geometric Progression Basic Guide:-A sequence of non-zero numbers is a Geometric Progression (G.P.) if the ratio of any term and its preceding term is always constant.

A Geometric Progression (G.P.) is given by a, ar, ar2, ar3, ...
where a = the first term , r = the common ratio


Examples for Geometric Progressions
1, 3, 9, 27, ... is a geometric progression (G.P.) with a = 1 and r = 3


2, 4, 8, 16, ... is a geometric progression (G.P.) with a = 2 and r = 2

Nth term of a geometric progression (G.P.)

Sum of first N terms in a geometric progression (G.P.)

Readers' Choice