Fibonacci series by Recursion in c

Posted by Tushar Bedekar

Introduction:-

http://www.allaboutcomputing.net/
Recursion is the process of repeating items in a self-similar way. In other words recursion is a process in which a same set of a statement/expressions are executed large no of times in such a manner that after the execution of a certain set of a statement/expression, again the same set of a statement/expressions are being executed until the condition is satisfied. Generally this kind of a process takes place in the in functions in which a function calls itself. The following is the syntax of the recursive function:-
void recursion()
{
   recursion(); /* function calls itself */
}

int main()
{
   recursion();
}
http://www.allaboutcomputing.net/Actually most of the programming languages support recursion an C programming language is one of them i.e., a function to call itself. But while using recursion, programmers need to be careful to define an exit condition from the function, otherwise it will go in infinite loop.
Recursive function are very useful to solve many mathematical problems like to calculate factorial of a number, generating Fibonacci series, etc.

Program me:-


/* Fibonacci by Recursion */
#include<stdio.h>
http://www.allaboutcomputing.net/
int fib(int); int main() { printf("Type any value : "); printf("\nNth value: %d",fib(getche()-'0')); return 0; } int fib(int n) { if(n<=1) return n; return(fib(n-1)+fib(n-2)); }
Read More

C Programming to Explain Type Casting

Posted by Tushar Bedekar

Introduction:-

Type casting is a way to convert a variable from one data type to another data type. For example, if you want to store a long value into a simple integer then you can type cast long to int. You can convert values from one type to another explicitly using the cast operator as follows:


Program me:-

#include< stdio.h>
#include< conio.h>
int main( )
{
int n,i,j,fact;
float sum=0;
clrscr();
for(i=1; i<=7; i++) { fact=1; for(j=i; j>=1; j--)                       // to find the factorial
fact=fact*j;

sum=sum+(float)i/fact;
}
printf("\nSum : %f",sum);
getch();
return 0;
}

Read More

Modifiers in C Programming Language

Posted by Tushar Bedekar
C Programming Modifier
As We Have discussed in the last article about C Programming   the data types have some modifiers preceding them. The use of these modifiers changes the meaning of the base type.

The memory in the computer is organized in terms of units called bytes. One  byte consists of 8 bits and bit is a smallest unit of memory.

Need of Data Modifiers:

The Need of modifiers can be understood by the help of following.Let us take an example of a Program where we need to input the “Salary” of “Employees” in a team. This program will accept the salary as an input from user and then calculate the Income Tax of that user. We use “int” to store the Salary of the employee as we are assuming that the salary will be in “Whole Numbers”.
C Programming Modifier

An integer data type takes 2 Bytes of Memory and we are aware that the Salary of any of the employee can not be “Negative”. We are using “2 Bytes” to store the memory of an Employee and we can easily save 1 Byte over there by removing the “Signed Part” in the integer. This positive value can easily be stored in “1 Bye Int” This leads us to the user of Data Type Modifiers.

Types of Data Modifiers in C:

Basically c programming language consist of 3 basic modifiers.The modifiers are listed below :


Signed Type Modifier:



All data types are “signed” by default. Signed Data Modifier implies that the data type variable can store positive values as well as negative values.


For example, if we need to declare a variable to store temperature, it can be negative as well as positive.

C Programming Modifier
signed int temperature;


Or


int temperature;



Unsigned Type Modifier:



If we need to change the data type so that it can only store only store positive values, “unsigned” data modifier is used.


For example, if we need to declare a variable to store the salary of an employee as explained above, we will use “Unsigned” Data Qualifier here.


unsigned int salary;


Long Type Modifier:


Sometimes while coding a program, we need to increase the Storage Capacity of a variable so that it can store values higher than its maximum limit which is there as default. In such situations or programs, we need to make use of the “long” data type qualifier. “long” type modifier doubles the “length” of the data type when used along with it.

C Programming Modifier
For example, if we need to store the “annual turnover” of a company in a variable, we will make us of this type qualifier.


long int turnover;


This variable will take 4 Bytes in memory.



Short Type Modifier:



A “short” type modifier does just the opposite of “long”. If one is not expecting to see high range values in a program and the values are both positive & negative.

C Programming Modifier
For example, if we need to store the “age” of a student in a variable, we will make use of this type qualifier as we are aware that this value is not going to be very high.


short int age;


This variable will consume only 1 Byte in memory.



Example

We can apply the above mentioned modifiers to integer (int) and character (char) base types.


1. Integer Type Modifiers:



* We can use all the above mentioned Type Modifiers for int data type in C Language

* Short int and long int are also termed as short and long respectively.
* Int is signed & unsigned by default.


2. Character Type Modifiers:



* Variables of type char consume 1 byte in memory.

* Char can be signed or unsigned only.
* They have a range of -128 to 127 and 0 to 255 for signed & unsigned respectively.


3. Float Type & Double Type Modifier:



There are 3 types of float type modifiers as given below:

C Programming Modifier


* float

* double
* long double

Double is same as long float. Float type occupies 4 bytes of memory. Type double occupies 8 bytes. Long double occupies 10 bytes. The exception to this is long double, which modifies the size of the double data type to 10 bytes. Please note that in some compilers this has no effect.



Note: We may use long modifier with double data type but it cannot be used with float, i.e. long double is allowed but long float is not allowed because long float is equal to double.


For More Info Download:-

                                                                                                                                                                       
Tushar
                                                           
Read More

What is a Hard Drive and How it Works

Posted by Tushar Bedekar

What is a Hard Drive:-

Inside a hard rive
Almost all desktop computers as well as laptops have a hard drive inside them, but do you really know what they are? Many people when they hear the word hard drive, think that it refers to the computer as a whole. In reality, though, the hard drive is just one of many different pieces that comprise a computer. The hard drive is one of the most important parts of your computer because it is used as a long-term storage space for your data. What that means, is regardless of whether or not the computer is on, or you lose power, the data will still stay stored on this hard drive keeping it safe. 
A hard drive is an integral part of your computer as your operating system and all your data are typically stored there. In the majority of the situations, if you did not have a working hard drive, or the hard drive malfunctions, you would not be able to boot your computer into the operating system and would get an error. 

How hard drives work:

The very interesting thing is that every one wants to know that how the Hard Drive works and how the data gets stored permanently for a long time even if the power is off.

A hard drive consists of the following:


    hard drive
  • Magnetic platters - Platters are the round plates in the image above. Each platter holds a certain amount of information, so a drive with a lot of storage will have more platters than one with less storage. When information is stored and retrieved from the platters it is done so in concentric circles, called tracks, which are further broken down into segments called sectors.
  • Arm - The arm is the piece sticking out over the platters. The arms will contain read and write heads which are used to read and store the magnetic information onto the platters. Each platter will have its own arm which is used to read and write data off of it.
  • Motor - The motor is used to spin the platters from 4,500 to 15,000 rotations per minute (RPM). The faster the RPM of a drive, the better performance you will achieve from it.
When a the computer wants to retrieve data off of the hard drive, the motor will spin up the platters and the arm will move itself to the appropriate position above the platter where the data is stored. The heads on the arm will detect the magnetic bits on the platters and convert them into the appropriate data that can be used by the computer.Actually these magnetic Bits are also refers to as a magnetic domains which gets align themselves according to the binary zeroes and ones. 
Conversely, when data is sent to the drive, the heads will this time, send magnetic pulses at the platters changing the magnetic properties of the platter, and thus storing your information.
It is important to note, that since the data stored on your hard drive is magnetic, that why the people are supposed to warn that don`t take the magnet near the Hard drive because it may affect the magnetic Data Stored on the Hard Drive. 


Hard Drive Interfaces:-



Hard Drive
A hard drive connects to your computer through a specific type of interface. The interface on your hard drive must match the corresponding interface on your motherboard. If you purchase a new hard drive that has a interface which doesn't matches with the interface of the Mother Board Installed on your Computer, then it will not work in your computer. Basically there are three interfaces that have become the standard for connecting your hard to your computer. Some information about each of these interfaces are below.
  • IDE or ATA - This is currently the most common interface used but is quickly becoming overcome by the newer SATA interface. Hard drives using this type of interface have speeds up to 100 Mbps.
  • SATA - A newer interface that uses less bulky cables and has speeds starting at 150 Mbps for SATA and 300 Mbps for SATA II. Almost all computer manufacturers have started using SATA drives.
  • SCSI - This type of interface is typically used in a business environment for servers. Hard Drives designed for a SCSI interface tend to have a faster RPM which therefore provides better performance.
Read More

C Programming Data Type

Posted by Tushar Bedekar
In C, variable(data) should be declared before it can be used in program. Data types are the keywords, which are used for assigning a type to a variable.In other words we can define the data type as a keyword which specifies the type of the data to be processed during the execution of the program me. 

Data types determine the following:

• Range of the data
• Type of the data stored
• Number of bytes it occupies in memory





C supports following data types:

• int – occupies 2 (16-bit compiler) or 4 bytes (32-bit compiler) of memory
• float – occupies 4 byes of memory
• double – occupies 8 bytes of memory
• char – occupies 1 byte of memory

Integer Data Type:-

int is used to define integer numbers. It occupies 2 bytes of memory (16-bit compiler).Keyword int is used for declaring the variable with integer type. For example:
The size of int is either 2 bytes(In older PC's) or 4 bytes. If you consider an integer having size of 4 byte( equal to 32 bits), it can take 232 distinct states as: -231,-231+1, ...,-2, -1, 0, 1, 2, ..., 231-2, 231-1
Similarly, int of 2 bytes, it can take 216 distinct states from -215 to 215-1. If you try to store larger number than 231-1, i.e,+2147483647 and smaller number than -231, i.e, -2147483648,  program will not run correctly.

Float Data Type:-

float is used to define floating type numbers. It occupies 4 bytes of memory
(16-bit compiler).Variables of floating types can hold real values(numbers) such as: 2.34, -9.382 etc. Keywords either float or double is used for declaring floating type variable. For example:

Double Data Type:-

double is used to store big floating point numbers. It reserves 8 bytes of memory (16-bit compiler)

Difference between float and double:-

Generally the size of float(Single precision float data type) is 4 bytes and that of double(Double precision float data type) is 8 bytes. Floating point variables has a precision of 6 digits whereas the the precision of double is 14 digits.
Note: Precision describes the number of significant decimal places that a floating values carries.

Char Data Type:-

char is used to store characters. It occupies 1 byte of memory (16-bit compiler).The size of char is 1 byte. The character data type consists of ASCII characters. Each character is given a specific value. For example:

Summary:

Following table is applicable for 16-bit compiler.

Read More

Asus Zenfone 5-Five Fearures You Need To Know

Posted by Tushar Bedekar
The Taiwan based company; Asus that is rapidly expanding and spreading its wings all over the globe have launched a new series of budget friendly smartphones called the Zenfone. The Zenfone series has three models, Zenfone 4, Zenfone 5 and Zenfone 6 which were revealed at CES this year. The company has managed to create a lot of buzz in the Indian market and has raised many eyebrows because of its affordable price.  
This article reviews the second model in the series, Zenfone 5. This Smartphone has certainly got enough attention mainly because of its ergonomic design. It has basic looks yet it gives a high-end feel. The phone very comfortably sits in the hand, which is why it becomes easier to handle the phone. It has three navigation buttons namely Back, Home and recent. The five features which make this phone worth giving a shot are-

Mesmerizing Display:-

The Smartphone boasts of a 5-inch IPS HD display with great viewing angles. The screen has a pixel density of 294 ppi which delivers crisp and sharp pictures and the colors look original and vibrant. One drawback about the display is that the screen is very reflective and the contents appear to fade a little in the sunlight. This problem can be solved by increasing the brightness. It has a corning Gorilla Glass 3 for the protection of the screen. The phone comes with a glove mode, which allows users to work on the phone even with gloves on, truly a great feature.

Excellent Hardware Configuration:-

The Smartphone clutches a RAM of 2GB with a 1.6 GHz dual-core Intel Atom Z2560 processor. This means all your apps and heavy graphic games will run very smoothly without any lag. Coming with a mammoth 64 GB of expandable memory, the Zenfone comprises of a handsome 8 GB or 16 GB internal memory. The device is a dual SIM (both micro SIM) with a battery of 2,110 mAh.

Appreciable Camera Quality:-

The Zenfone 5 sports an 8 megapixel rear camera with an LED flash and f/2.0 aperture lens. A 2 megapixel front camera is also present for video calling and selfie moments. The phone has few inbuilt camera apps that offer 18 different modes. The most notable camera tool is Time Rewind which saves upto 31 images beginning 2 seconds before the shutter button is pressed. The pictures clicked by the phone are decent in low light and give much more detail in a well lit environment.

Latest Android OS:-

Asus’s Zenfone works on android 4.3 Jelly Bean with company’s ZenUI skin on top. Asus has announced that the latest version of Android 4.4 Kitkat will be available very soon. The ZenUI gives you the option to customize the elements on screen like the transparency level and theme color. Google chrome is offered additionally with the default browser of the phone.

Affordable Price Tag:-

The Asus Zenfone 5 can be taken into consideration for people who want a big screen at a low price tag. Priced at 9,999/-, this smartphone is one of the best budget Smartphone in the 10K segment in India.

Author Bio:

The article has been written by Kundan Srivastava, who is passionate about technology. He's working at 91mobiles.com and writes about the latest in the tech domain, right from devices to innovations. He recommended Asus Zenfone 5 as one of the best budget Smartphone.


Publisher's Last Words:

This is guest post by Kundan Srivastava, Thanks to Kundan Srivastava for this awesome and useful information.if you want to post your article on http://www.allaboutcomputing.net you can contact me. For more about Computer programming and for many more about Computer or web designing stay connected with http://www.allaboutcomputing.net .
I hope you have got answers of some Questions by this small post and I know you have lot of questions, So please feel free to ask in comment section or you can mail me my    e mail id is : tushar.bedekar11@gmail.com 
Read More

Literals in C Programming

Posted by Tushar Bedekar
The term literal constant or literal refers to a value that occurs in a program and cannot be changed. The C language uses the term constant in place of the noun literal. The adjective literal adds to the concept of a constant the notion that we can speak of it only in terms of its value. A literal constant is nonaddressable, which means that its value is stored somewhere in memory, but we have no means of accessing that address.

Every literal has a value and a data type. The value of any literal does not change while the program runs and must be in the range of representable values for its type. The following are the available types of literals:


Types:-


  • Boolean
  • Integer
  • Character
  • Floating-point
  • String
  • C Compound literal
  • Vector literal
According to Wikipedia  a literal is a notation for representing a fixed value in source code. Almost all programming languages have notations for atomic values such as integers,floating-point numbers, and strings, and usually for booleans and characters; some also have notations for elements of enumerated types and compound values such as arrays,records, and objects. An anonymous function is a literal for the function type.

In contrast to literals, variables or constants are symbols that can take on one of a class of fixed values, the constant being constrained not to change. Literals are often used to initialize variables, for example, in the following, 1 is an integer literal and the three letter string in "cat" is a string literal:
Read More

How to open webpage in chrome browser offline

Posted by Tushar Bedekar

Many Times in the absence of the internet connectivity we are require to access the certain webpages that we have previously accessed when we have internet connectivity.For example during connectivity we a have opened Facebook,Gmail and Wikipedia etc. similarly when we are suppose to be inside the airplane there is no connectivity due to which we can`t access internet and In such situations if we open our chrome history an click on the previously sites than we see a page showing a dynasore saying that your computer is not connected to internet.


At the same time there is also no setting in the chrome browser by using which you are able to use chrome in the offline mode so by using the trick Given below you can use your browser in the offline mode.


Offline reading in chrome(Trick):-

  • first of all open chrome browser.
  • In the address bar write chrome://flags/#enable-offline-mode
  • then press enter.
  • now you will see an auto reload option in the window open in your browser.
  • which is set in the default mode.
  • revert that option to enable mode.
  • then restart your chrome browser.
Then after restarting your chrome browser move to history by pressing ctrl+H 
select the site that you want to see offline and enjoy.







Warning 

  • We are not responsible for any damages that may happened by using this Techniques. 
  • Use this guide at your own risk. We shall not have any liability or responsibility for whatever happens to you and your device by using the instructions in this guide.
  • The instructions provided in this tutorial for educational purpose only. There is no guarantee that these steps will work for your device.
  •  Applying this guide to any other device or any other model may produce many problems.
  • Read and Understand the whole tutorial first, before going to perform the steps.
  • At the same time this content is not to harm any one but it is only for educational purpose.
Read More
back to top