Concept:
In this C++ Program the problem is to find age and days of birth when Date of Birth and present date is given. So main concept behind it is to find the difference between two given dates, using class structure in C++ Programming Language.
To Find Age in format Year/Month/Day

Year(Final) = Date(PresentYear) – BirthYear.
Month(Final) = Date(PresentMonth) – BirthMonth.
Day(Final) = Date(PresentDay) – BirthDay.

Again another function is to find the total days after birth.
To Find total days after birth

`totalDays = (finalYear*365 + finalMonth*30 + finalDay);`
```/* * Program to calculate age and days * Given * --- Current date * --- Your Date of Birth * Results * --- Finds out your age in format of Year/Month/Day * --- Finds out Total Days * Note: I have not calculated the days with refrence to Leap Year that occurs in 4 Years gap. * Author: Luzan Baral * Twitter: http://twitter.com/luzanb */   #include&lt;iostream&gt; #include&lt;cstdlib&gt; #include&lt;conio.h&gt; using namespace std;   class Find_DOB{ public: int finalYear; // The Year int birthYear; // The Year (Maths) int presentYear; // The Year (Current) int finalMonth; // The Month int birthMonth; // The Month (Maths) int presentMonth; // The Month (Current) int finalDay; // The Day int birthDay; // The Day (Maths) int presentDay; // The Day (Current) long int totalDays; //Stores total days //default constructur Find_DOB(){ finalYear=0; birthYear=0; presentYear=0; finalMonth=0; birthMonth=0; presentMonth=0; finalDay=0; birthDay=0; presentDay=0; totalDays=0; } //fuction to get today's date void get_todayDate(){ cout &lt; &lt; "Please enter the current date. (In Numeral)" &lt;&lt; endl; cout &lt;&lt; "" &lt;&lt; endl; cout &lt;&lt; "" &lt;&lt; endl; cout &lt;&lt; "Enter the current year: "; cin &gt;&gt; presentYear; // Enter current year of date and hold in YYY. cout &lt; &lt; "Enter the current month: "; cin &gt;&gt; presentMonth; // Enter current month of date and hold in MMM. cout &lt; &lt; "Enter the current day: "; cin &gt;&gt; presentDay; // Enter current day of date and hold in DDD. cout &lt; &lt; "" &lt;&lt; endl; cout &lt;&lt; "" &lt;&lt; endl; } void get_DOB(){ // The DOB. cout &lt;&lt; "Please enter your DOB." &lt;&lt; endl; cout &lt;&lt; "Year: "; cin &gt;&gt; birthYear; // Enter year of birth and hold in YY. cout &lt; &lt; "Month: "; cin &gt;&gt; birthMonth; // Enter month of birth and hold in MM. cout &lt; &lt; "Day: "; cin &gt;&gt; birthDay; // Enter day of birth and hold in DD. } void calc_days(){ finalYear = abs(presentYear - birthYear); // Year(Final) = Date(PresentYear) - BirthYear. finalMonth = abs(presentMonth - birthMonth); // Month(Final) = Date(PresentMonth) - Birth(Month). finalDay = abs(presentDay - birthDay); // Day(Final) = Date(PresentDay) - BirthDay. cout &lt; &lt; "" &lt;&lt; endl; cout &lt;&lt; "You are " &lt;&lt; finalYear &lt;&lt; "/" &lt;&lt; finalMonth &lt;&lt; "/" &lt;&lt; finalDay &lt;&lt; " years old." &lt;&lt; endl; // Result. totalDays = (finalYear*365 + finalMonth*30 + finalDay); cout &lt;&lt; "Total of "&lt;&lt; totalDays &lt;&lt;" Days."&lt;&lt;endl; } };   int main() { Find_DOB obj; // The Date. cout &lt;&lt; "This is a progran to tell how old you are..." &lt;&lt; endl;   obj.get_todayDate(); obj.get_DOB(); obj.calc_days();   getch(); return 0; }```

Now that Visual Studio 2013 has been released with new features, I finally got a copy of Visual Studio 2013 and took it for a ride this week. Here’s a quick tour of what Visual Studio 2013 has to offer; I focus on basic IDE enhancements, web development, productivity gains, and Windows-specific development.and I have had a little play around with it, I thought I would write about some of my favorite new IDE features. Microsoft has added in some useful features that will really make using the IDE a richer experience. Continue Reading…

A header file is a file containing C declarations and macro definitions to be shared between several source files. You request the use of a header file in your program by including it, with the C Preprocessing directive ‘#include’.

Microsoft won’t let programmers code notepad++ to write codes. HTML 5 is very popular in this web era, but how can developer from Visual Studio 2010 use HTML 5 support in their package when Visual Studio 2010 solely does not support HTML 5. But does that stops programmers, surely not, you can update your Studio for that.

All you will be needing is Visual Studio 2010 and a web browser.

Why do I need Web Browser ?

If you want Visual Studio 2010 to support HTML 5. You need to update your Visual Studio 2010 to Visual Studio 2010 Service Pack 1.

### How to update Microsoft Visual Studio 2010 to VS 2010 SP1?

Basically, there are two ways to update Microsoft Visual Studio 2010 to Visual Studio 2010 Service Pack 1:

• From Micorsoft Website
• Open windows update, the system will automatically find vs2010 update file, size around 600MB

Now after you have finished updating your Visual Studio 2010, you can add HTML 5 support, by following below steps.

1. Open Visual Studio 2010 SP 1.
2. Go to Tools
3. Click on Options
4. Choose HTML
5. Choose Validation
6. On target Select HTML 5
7. Click Ok

How to use HTML5 in Visual Studio 2010

You can follow us on Twitter, add us to your circle on Google+ or like our Facebook page . We will be providing you with best online tutorial on Programming, Database, Data Structures, Engineering, Case Studies and Computer Fundamentals.

So far I think you have already read our tutorial on ‘Understanding Use of Arrays in C Programming.

Unlike array, a structure is a package of one or usually more variables which are grouped under a single name. Structures are not like arrays: a structure can hold any mixture of different types of data: it can even hold arrays of different types. A structure can be as simple or as complex as the programmer desires. Continue Reading…

Heap sort is a relatively simple algorithm built upon the heap data structure. A naive implementation requires additional space, but it is possible to do a heap sort in place. Heap sort has guaranteed O(n*log(n))) performance, though the constant factor is typically a bit higher than for other algorithms such as Quick sort. Heap sort is not a stable sort, so the original ordering of equal elements may not be maintained. Continue Reading…

As in my last post we talked all about fundamentals of Pointers in C. In this we will some more complex things related to Pointers so you need to more concentrate while you read the post. So in this part we will develop more complex ideas about Pointers.

1. Constant pointer and pointer to constant.
2. Pointer to pointer with an example
3. Array of pointers with an example
4. Pointer to functions with an example

### C Constant Pointer and Pointer to Constant

As a developer, you should understand the difference between constant pointer and pointer to constant.

C Constant pointer
A pointer is said to be constant pointer when the address its pointing to cannot be changed.

Lets take an example :

```char ch, c;
char *ptr = &ch
ptr = &c```

In the above example we defined two characters (‘ch’ and ‘c’) and a character pointer ‘ptr’. First, the pointer ‘ptr’ contained the address of ‘ch’ and in the next line it contained the address of ‘c’. In other words, we can say that Initially ‘ptr’ pointed to ‘ch’ and then it pointed to ‘c’.

But in case of a constant pointer, once a pointer holds an address, it cannot change it. This means a constant pointer, if already pointing to an address, cannot point to a new address.

If we see the example above, then if ‘ptr’ would have been a constant pointer, then the third line would have not been valid.

A constant pointer is declared as :

*const
For example :

```#include

int main(void)
{
char ch = 'c';
char c = 'a';

char *const ptr = &ch; // A constant pointer
ptr = &c; // Trying to assign new address to a constant pointer. WRONG!!!!

return 0;
}```

When the code above is compiled, compiler gives the following error :

```\$ gcc -Wall constptr.c -o constptr
constptr.c: In function ‘main’:
constptr.c:9: error: assignment of read-only variable ‘ptr’```

So we see that, as expected, compiler throws an error since we tried to change the address held by constant pointer.

Now, we should be clear with this concept. Lets move on.

### C Pointer to Constant

This concept is easy to understand as the name simplifies the concept. Yes, as the name itself suggests, this type of pointer cannot change the value at the address pointed by it.

Lets understand this through an example :

```char ch = 'c';
char *ptr = &ch
*ptr = 'a';```

In the above example, we used a character pointer ‘ptr’ that points to character ‘ch’. In the last line, we change the value at address pointer by ‘ptr’. But if this would have been a pointer to a constant, then the last line would have been invalid because a pointer to a constant cannot change the value at the address its pointing to.

A pointer to a constant is declared as :

const *;
For example :

```#include

int main(void)
{
char ch = 'c';
const char *ptr = &ch; // A constant pointer 'ptr' pointing to 'ch'
*ptr = 'a';// WRONG!!! Cannot change the value at address pointed by 'ptr'.

return 0;
}```

When the above code was compiled, compiler gave the following error :

```\$ gcc -Wall ptr2const.c -o ptr2const
ptr2const.c: In function ‘main’:
ptr2const.c:7: error: assignment of read-only location ‘*ptr’```

So now we know the reason behind the error above ie we cannot change the value pointed to by a constant pointer.

### C Pointer to Pointer

Till now we have used or learned pointer to a data type like character, integer etc. But in this section we will learn about pointers pointing to pointers.

As the definition of pointer says that its a special variable that can store the address of an other variable. Then the other variable can very well be a pointer. This means that its perfectly legal for a pointer to be pointing to another pointer.

Lets suppose we have a pointer ‘p1′ that points to yet another pointer ‘p2′ that points to a character ‘ch’. In memory, the three variables can be visualized as :

So we can see that in memory, pointer p1 holds the address of pointer p2. Pointer p2 holds the address of character ‘ch’.

So ‘p2′ is pointer to character ‘ch’, while ‘p1′ is pointer to ‘p2′ or we can also say that ‘p2′ is a pointer to pointer to character ‘ch’.

Now, in code ‘p2′ can be declared as :

`char *p2 = &ch;`

But ‘p1′ is declared as :

`char **p1 = &p2;`

So we see that ‘p1′ is a double pointer (ie pointer to a pointer to a character) and hence the two *s in declaration.

Now,

‘p1′ is the address of ‘p2′ ie 5000
‘*p1′ is the value held by ‘p2′ ie 8000
‘**p1′ is the value at 8000 ie ‘c’
I think that should pretty much clear the concept, lets take a small example :

```#include

int main(void)
{
char **ptr = NULL;

char *p = NULL;

char c = 'd';

p = &c;
ptr = &p;

printf("\n c = [%c]\n",c);
printf("\n *p = [%c]\n",*p);
printf("\n **ptr = [%c]\n",**ptr);

return 0;
}```

Here is the output :

```\$ ./doubleptr

c = [d]

*p = [d]

**ptr = [d]```

### C Array of Pointers

Just like array of integers or characters, there can be array of pointers too.

An array of pointers can be declared as :

`*[<number-of-elements];`

For example :

`char *ptr[3];`

The above line declares an array of three character pointers.

Lets take a working example :

```#include

int main(void)
{
char *p1 = "Himanshu";
char *p2 = "Arora";
char *p3 = "India";

char *arr[3];

arr[0] = p1;
arr[1] = p2;
arr[2] = p3;

printf("\n p1 = [%s] \n",p1);
printf("\n p2 = [%s] \n",p2);
printf("\n p3 = [%s] \n",p3);

printf("\n arr[0] = [%s] \n",arr[0]);
printf("\n arr[1] = [%s] \n",arr[1]);
printf("\n arr[2] = [%s] \n",arr[2]);

return 0;
}```

In the above code, we took three pointers pointing to three strings. Then we declared an array that can contain three pointers. We assigned the pointers ‘p1′, ‘p2′ and ‘p3′ to the 0,1 and 2 index of array. Let’s see the output :

\$ ./arrayofptr

p1 = [Pixie]

p2 = [Auror]

p3 = [Nepal]

arr[0] = [Pixie]

arr[1] = [Auror]

arr[2] = [Nepal]

So we see that array now holds the address of strings.

### C Function Pointers

Just like pointer to characters, integers etc, we can have pointers to functions in C programming Languages.

A function pointer can be declared as :

(*) (type of function arguments)
For example :

`int (*fptr)(int, int)`

The above line declares a function pointer ‘fptr’ that can point to a function whose return type is ‘int’ and takes two integers as arguments.

Lets take a working example :

```#include

int func (int a, int b)
{
printf("\n a = %d\n",a);
printf("\n b = %d\n",b);

return 0;
}

int main(void)
{
int(*fptr)(int,int); // Function pointer

fptr = func; // Assign address to function pointer

func(2,3);
fptr(2,3);

return 0;
}```

In the above example, we defined a function ‘func’ that takes two integers as inputs and returns an integer. In the main() function, we declare a function pointer ‘fptr’ and then assign value to it. Note that, name of the function can be treated as starting address of the function so we can assign the address of function to function pointer using function’s name. Lets see the output :

\$ ./fptr

a = 2

b = 3

a = 2

b = 3

So from the output we see that calling the function through function pointer produces the same output as calling the function from its name.

To conclude, in this article we touched some of the advanced concepts related to pointers. There can be some interesting problems related to pointers, which i might cover in some future article.

This program will let you convert temperature from one unit to other unit. The first program will convert Celsius to Kelvin. The second will convert Kelvin to Celsius. The next will convert Celsius to Fahrenheit. The last one will convert Fahrenheit. So you can make more programs by using more different types of unit and their conversion.

### Program to convert Celsius to Kelvin

```#include<iostream.h>
#include<conio.h>
void main()
{
//clear the screen.
clrscr();
//declare variable type float
float a,b;
//Input the Temperature in given unit save them in ‘a’
cout<<”Enter the Temperature in Celsius”<<endl;
cin>>a;
//convert and save it in ‘b’
b=a+273;
//show the output ‘b’
cout<<”Temperature in Kelvin is “<<b;
//get character
getch();
}```

Output

Enter the Temperature in Celsius
27.5
Temperature in Kelvin is 300.5

### Program to convert Kelvin to Celsius

```#include<iostream.h>
#include<conio.h>
void main()
{
//clear the screen.
clrscr();
//declare variable type float
float a,b;
//Input the Temperature in given unit save them in ‘a’
cout<<”Enter the Temperature in Kelvin”<<endl;
cin>>a;
//convert and save it in ‘b’
b=a-273;
//show the output ‘b’
cout<<”Temperature in Celcius is “<<b;
//get character
getch();
}```

Output

Enter the Temperature in Celsius
300.5
Temperature in Kelvin is 27.5

### Program to convert Celsius to Fahrenheit

```#include<iostream.h>
#include<conio.h>
void main()
{
//clear the screen.
clrscr();
//declare variable type float
float a,b;
//Input the Temperature in given unit save them in ‘a’
cout<<”Enter the Temperature in Celsius”<<endl;
cin>>a;
//convert and save it in ‘b’
b=1.8*a+32.0;
//show the output ‘b’
cout<<”Temperature in Fahrenheit is “<<b;
//get character
getch();
}```

Output

Enter the Temperature in Celsius
56
Temperature in Fahrenheit is 132.800003

### Program to convert Fahrenheit to Celsius

```#include<iostream.h>
#include<conio.h>
void main()
{
//clear the screen.
clrscr();
//declare variable type float
float a,b;
//Input the Temperature in given unit save them in ‘a’
cout<<”Enter the Temperature in Fahrenheit”<<endl;
cin>>a;
//convert and save it in ‘b’
b=(a-32.0)/1.8;
//show the output ‘b’
cout<<”Temperature in Celsius is “<<b;
//get character
getch();
}```

Output

Enter the Temperature in Fahrenheit
132.800003
Temperature in Celsius is 56.0

### How does Temperature Conversion works in C++?

1. You enter the Temperature in given unit and is saved in variable ‘a’.
2. The Temperature is converted according to conversion formula and is saved in ‘b’.
3. Variable ‘b’ is shown by cout.

### Extending Unit of Temperature Conversion with C++ Codes

The Program can be extended by adding more unit to conversion and by adding their Conversion formula for other unit and more variables can be added to program to convert multiple temperatures. Like wise you can also use following unit for conversion :-

• Kelvin
• Celsius
• Fahrenheit

### Explanation of C++ Program to Preform Temperature Conversion

1. Include ‘iostream.h’ and ‘conio.h’ files.
3. Start program by first clearing the screen.
4. Declare the variables as float (name them as you want.)
5. Add cout and cin of variables you want to convert from.(as shown in program)
6. Convert the Temperature from variable and save them in one variable.
7. Cout the converted Temperature variable.

At the end

You learnt creating the c++ program of conversion of  Temperature from one unit to other unit. So now enjoy the program.

You can follow us on Twitter, add us to your circle on Google+ or like our Facebook page . We will be providing you with best online tutorial on Programming, Database, Data Structures, Engineering, Case Studies and Computer Fundamentals.

This project of “ LIBRARY MANAGEMENT SYSTEM” of gives us the complete information about the library. We can enter the record of new books and retrieve the details of books available in the library. We can issue the books to the students and maintain their records like modifying information, searching for book information and deleting records.

Understanding the working of Library Management System would be more easier if you have gone through our previous tutorials on issuing books out of library and returning books to library. Such, functions in a Library Management System Software project describes how the control flow of the program is to be maintained. Continue Reading…

With my experience of studying Programming with C, the toughest part of C Programming Language was to understand the use of Pointers in C Programming Language. But I must say Pointer is the most important thing in C which makes it Great. And anyone either a Professional or a Student Programmer can not deny the fact that without learning the Pointers in C he couldn’t see the beauty of C Language.

This article ‘Understanding Pointers in C Programming with Examples’, will explore the idea of Pointer, it’s declaration, use, initialization and example, moreover we will also be talking about the fundamental logic behind pointers with more useful example using Pointers concept.

Through proper use of pointers a developer can directly access memory from his/her code which makes memory related operations very fast. But, as always, with great power comes great responsibility.

A developer has to very carefully make use of pointers in order to avoid some problems that can be nightmare to debug.

So the very first question is What are Pointers?

### What are Pointers?

Different from other normal variables which can store values, pointers are special variables that can hold the address of a variable. Since they store memory address of a variable, the pointers are very commonly said to “point to variables”. Lets try to understand the concept.

Memory Allocation using Pointer in C

As shown in the above diagram:

• A normal variable ‘var’ has a memory address of 1001 and holds a value 50.
• pointer variable has its own address 2047 but stores 1001, which is the address of the variable ‘var’

### Why Have Pointers?

Pointers solve two common software problems. First, pointers allow different sections of code to share information easily. You can get the same effect by copying information back and forth, but pointers solve the problem better. Second, pointers enable complex ”linked” data structures like linked lists and binary trees.

### How to Declare a Pointer?

A pointer is declared as :

`<pointer type> *<pointer-name>`

In the above declaration :

1. pointer-type : It specifies the type of pointer. It can be int,char, float etc. This type specifies the type of variable whose address this pointer can store.
2. pointer-name : It can be any name specified by the user. Professionally, there are some coding styles which every code follows. The pointer names commonly start with ‘p’ or end with ‘ptr’

An example of a pointer declaration can be :

`char *chptr;`

In the above declaration, ‘char’ signifies the pointer type, chptr is the name of the pointer while the asterisk ‘*’ signifies that ‘chptr’ is a pointer variable.

### How to initialize a Pointer?

A pointer is initialized in the following way :

```<pointer declaration(except semicolon)> = <address of a variable>

OR

<pointer declaration>
<name-of-pointer> = <address of a variable>```

Note that the type of variable above should be same as the pointer type. (Though this is not a strict rule but for beginners this should be kept in mind).

For example :

```char ch = 'c';
char *chptr = &ch; //initialize

OR

char ch = 'c';
char *chptr;
chptr = &ch //initialize```

In the code above, we declared a character variable ch which stores the value ‘c’. Now, we declared a character pointer ‘chptr’ and initialized it with the address of variable ‘ch’.

Note that the ‘&’ operator is used to access the address of any type of variable.

### How to Use a Pointer?

A pointer can be used in two contexts.

Context 1: For accessing the address of the variable whose memory address the pointer stores.

Again consider the following code :

```   char ch = 'c';
char *chptr = &ch;```

Now, whenever we refer the name ‘chptr’ in the code after the above two lines, then compiler would try to fetch the value contained by this pointer variable, which is the address of the variable (ch) to which the pointer points. i.e. the value given by ‘chptr’ would be equal to ‘&ch’.

For example :

`char *ptr = chptr;`

The value held by ‘chptr’ (which in this case is the address of the variable ‘ch’) is assigned to the new pointer ‘ptr’.

Context 2: For accessing the value of the variable whose memory address the pointer stores.

Continuing with the piece of code used above :

```char ch = 'c';
char t;
char *chptr = &ch;
t = *chptr;```

We see that in the last line above, we have used ‘*’ before the name of the pointer. What does this asterisk operator do?

Well, this operator when applied to a pointer variable name(like in the last line above) yields the value of the variable to which this pointer points. Which means, in this case ‘*chptr’ would yield the value kept at address held by chptr. Since ‘chptr’ holds the address of variable ‘ch’ and value of ‘ch’ is ‘c’, so ‘*chptr’ yeilds ‘c’.

When used with pointers, the asterisk ‘*’ operator is also known as ‘value of’ operator.

### An Example of C Pointers

Consider the following code :

CODE :

```#include <stdio.h>

int main(void)
{
char ch = 'c';
char *chptr = &ch;

int i = 20;
int *intptr = &i;

float f = 1.20000;
float *fptr = &f;

char *ptr = "I am a string";

printf("\n [%c], [%d], [%f], [%c], [%s]\n", *chptr, *intptr, *fptr, *ptr, ptr);

return 0;
}```

OUTPUT :

```\$ ./pointers

[c], [20], [1.200000], [I], [I am a string]```

To debug a C program, use gdb. The above code covers all the common pointers. The first three of them are very trivial now to understand so lets concentrate on the fourth one. In the fourth example, a character pointer points to a string.

Read more: Understanding Functions in C Programming

In C, a string is nothing but an array of characters. So we have no staring pointers in C. Its the character pointers that are used in case of strings too.

Now, coming to the string, when we point a pointer to a string, by default it holds the address of the first character of the string. Lets try to understand it better.

The string, ‘I am String’ in memory is placed as :

```1001   1002    1003    1004   1005   1006   1007   1008   1009   1010
I      a       m       S      t      r      i      n      g```

Since characters occupy one byte each, so they are placed like above in the memory. Note the last character, its a null character which is placed at the end of every string by default in C. This null character signifies the end of the string.

Now coming back to the point, any character pointer pointing to a string stores the address of the first character of the string. In the code above, ‘ptr’ holds the address of the character ‘I’ ie 1001. Now, when we apply the ‘value of’ operator ‘*’ to ‘ptr’, we intend to fetch the value at address 1001 which is ‘I’ and hence when we print ‘*ptr’, we get ‘I’ as the output.

Also, If we specify the format specifier as ‘%s’ and use ‘ptr’ (which contains the starting address of the string), then the complete string is printed using printf. The concept is that %s specifier requires the address of the beginning byte of string to display the complete string, which we provided using ‘ptr’ (which we know holds the beginning byte address of the string). This we can see as the last print in the output above.

### Pointers as Structure Objects

Consider the following code :

CODE:

```#include<stdio.h>

struct st{
int a;
char ch;
};

int main(void)
{
struct st obj;
struct st *stobj = &obj;

stobj->a = 5;
stobj->ch = 'a';

printf("\n [%d] [%c]\n", stobj->a, stobj->ch);
return 0;
}```

OUTPUT:

```\$ ./pointers

[5] [a]```

In the above code, we have declared a pointer stobj of type ‘struct st’. Now since the pointer type is a structure, so the address it points to has to be of a ‘struct st’ type variable(which in this case is ‘obj’). Other interesting part is how structure elements are accessed using pointer variable ‘stobj’. Yes, When dealing with pointer objects, its a standard to use arrow operator -> instead of ‘.’ operator(which would have been used, had we used ‘obj’ to access the structure elements).

To conclude, In this article we studied the concept of pointers in C from scratch and then slowly built upon our understanding to more complex topics like using pointers as structure objects. This was a basic tutorial, we will cover more complex pointer concepts in the part-II of this article.

You can follow us on Twitter, add us to your circle on Google+ or like our Facebook page . We will be providing you with best online tutorial on Programming, Database, Data Structures, Engineering, Case Studies and Computer Fundamentals.

Serial port communication is one way to make connections between multiple devices in different environments as long as the equipment is connected to the serial port. serial communication typically used for controlling or monitoring the state of a device. In order to do the serial communication becomes more attractive and easy to be operated by another person, it would require an IDE ( Integrated Development Environment ) as the software that will be used for monitoring or control equipment connected to the serial port. one of the IDE in question is C # to create a simple serial port communication, can be done in the following way. Continue Reading…