Minggu, 05 September 2010

Initializing Numeric Variables

When you declare a variable, you instruct the compiler to set aside storage space for the variable. However, the value stored in that space--the value of the variable--isn't defined. It might be zero, or it might be some random "garbage" value. Before using a variable, you should always initialize it to a known value. You can do this independently of the variable declaration by using an assignment statement, as in this example:

int count;   /* Set aside storage space for count */
count = 0;   /* Store 0 in count */

Variable Declarations in C language

Before you can use a variable in a C program, it must be declared. A variable declaration tells the compiler the name and type of a variable and optionally initializes the variable to a specific value. If your program attempts to use a variable that hasn't been declared, the compiler generates an error message. A variable declaration has the following form:

Numeric Variable Types

C provides several different types of numeric variables. You need different types of variables because different numeric values have varying memory storage requirements and differ in the ease with which certain mathematical operations can be performed on them. Small integers (for example, 1, 199, and -8) require less memory to store, and your computer can perform mathematical operations (addition, multiplication, and so on) with such numbers very quickly. In contrast, large integers and floating-point values (123,000,000 or 0.000000871256, for example) require more storage space and more time for mathematical operations. By using the appropriate variable types, you ensure that your program runs as efficiently as possible.
C's numeric variables fall into the following two main categories:

Make New Project C with Dev C++


How to make new project C with Dev C++ ? You dont know how to use Dev C++ ? or you have not Dev C++ ?
if you have not Dev C++ you can download that sofwtare Download Dev C++
After you download that software and install it
follow this step to make new project with Dev C++
First of all ,
  • Open Dev C++
  • Klik File 
  • New
  • Select Project
So, will be appear this dialog

  • Select console application
  • Select C project
  • And write you project name in field nam (space is not allowed)



  • And klik ok
  • So, now you must select directory, where you want to save your project. In this example i select directory in drive D:



  • Make new folder
  • Open folder and klik ok
  • So, you window will be appear like this


  • Now you can write your script
  • If you want to debug or run program click these icon



  • It is easy,isn't ?
  • You can make console aplication and GUI application and other with Dev C++