Sunday, June 30, 2013

Data Types in C

In C we have many data types and each data type has its own range and its own specialization. Here is the table which gives you details about the data types and the range of each data type we are providing.

Variable Type
Keyword
Bytes Required
Range
Character
char
1
-128 to 127
Integer
int
2
-32768 to 32767
Short Integer
short
2
-32768 to 32767
Long Integer
long
4
-2,147,483,648 to 2,147,483,647
Unsigned character
unsigned char
1
0 to 255
Unsigned integer
unsigned int
2
0 to 65535
Unsigned short integer
unsigned short
2
0 to 65535
Unsigned long integer
unsigned long
4
0 to 4,294,967,295
Single Precision floating-point Number
float
4
1.2E-38 to 3.4E38
(Approx 7 digits precision)
Double precision floating-point number
double
8
2.2E-308 to 1.8E308
(Approx 19 digits precision)

Keywords in C

A keyword is a predefined word or a reserved word for a purpose. In C language there are totally 32 keywords. All the key words and their description is mentioned in the following tabular format. Please check the following table for a better understanding of each of the keyword.


Variables in C

A variable is a named data storage location in your computer's memory. By using a variable in the program, we are just referring to the data in our memory. To use the variables in our program, we must know how to create them. In creating a variable, there are certain conditions to be followed. They are

Conditions to setting Variable Names:

  • The name can contain letters, digits and the underscore character i.e., '_'.
  • The first character of the name must be a letter or an underscore.
  • If there is any change in the case of the letters, then they are treated as two different variables i.e., count  and Count are two different variables.
  • Keywords can't be a variable.

Saturday, June 29, 2013

Program without a Main Function

We would be wondering that we can write a C program without a main function. Generally we know that a C program cannot be executed without a main function. But we can execute it without main. Just try out the code below, it works fine even without a main function in it.

#include<stdio.h>
#define decode(s,t,u,m,p,e,d) m##s##u##t
#define begin decode(a,n,i,m,a,t,e)
int begin()
{
printf(” hello “);
}

Understanding a Program in C

Let us know more about a C program. A C program contains many components. If you observe the previous example, you can identify many things. Let us know more about what they are, why we have used them and how to use them.

Consider another example of C program which contains more components, than in the previous example and know what they are.

First C Program

Now, we are moving to our first program on C. This program just illustrates you to display the message Hello world,  but along with the program, we are going to understand the structure and the way we are supposed to write the program.

Example 1:


#include<stdio.h> 
main() 
{ 
printf("Hello World \n"); 
return 0; 
}

Friday, June 28, 2013

Creating a Program in C

While creating a program, we need to follow certain steps. These are the steps to be followed while creating any kind of C program.

  • Create the source code.
  • Compile the Source code.
  • Link the compiled code to create executable.
  • Run the executable code.

Basics of C Programming

For a programming language, we generally write the program in the high level language i.e., by using alphabets, numbers and symbols. But computer understands very low level language. Hence a program must undergo many transformations to convert into machine level language.

For a C program, 
  • User writes his thoughts in the form of program, called as Source File.
  • This file is converted by the compiler into an object file.
  • This object file is then linked with a linker and gets converted into Executable program.

Introduction to C

What is C?

C is a programming language that allows a programmer to communicate with the computer. C is a flexible language and adaptable language, and it is the most used languages in the world. It is a general purpose programming language and is more convenient to use than many powerful programming languages. 

C is designed and implemented on Unix Operating Systems, by Dennis Ritchie. In today's world, there are many high level languages to choose, but C takes the top position of all because of its simplicity and flexibility.

Thursday, June 27, 2013

Structure of JQuery

JQuery Synax

JQuery, the name itself says it is querying something. It means it selects a particular HTML element and performs some action on it. Hence the syntax of a JQuery is also in that format only.

$(selector).action(), where
  • $ is for representing it as a jQuery.
  • selector represents the HTML element to be selected.
  • action() represents the kind of action we perform on the selected element.

Wednesday, June 26, 2013

Introduction to JQuery

JQuery is nothing but a modified version of Java Scripts. JQuery is easier to learn and to implement. It is a JavaScript Library. Before learning JQuery, you need to know three things.

  • HTML
  • CSS
  • Java Script
And Remember another thing, you are just writing the Java Script in another way.

Tuesday, June 25, 2013

First Post

Hello Ram,

This is a blog for yourself. This is a blog just as a guide for you all the time what you know or what you want to keep remembered regularly...

Anyways have a nice posting, and a nice collection