Thursday, 16 January 2014

C Language Components


C Language Components

The four main components of C language are
1) The Character Set.
2) Tokens
3) Variables
4) Data Types


1) The Character Set :


 Character set is a set of valid characters that a language cab recognize. A character represents any letter, digit or any other sign.

* Letters           - A,B,C……Z or a,b,c …………z.

* Digits        -      0,1…………9

* Special Symbols        -      ~!@#$%^&.........

* White Spaces        -        Blank space, horizontal tab, carriage return,
new line, form feed.


2) Tokens: 

The smallest individual unit in a program is known as a token.
C has five tokens

i. Keywords
ii. Identifiers
iii. Constants
iv. Punctuations
v. Operators


i. Keywords:

 Keywords are reserved word in C. They have predefined meaning cannot changed. All keywords must be written in lowercase. Eg:- auto,long,char,short etc.

ii. Identifiers: -

 Identifiers refer to the names of variable, functions and arrays. These are user-defined names. An identifier in C can be made up of letters, digits and underscore. Identifiers may start with either alphabets or underscore. The underscore is used to make the identifiers easy to read and mark functions or library members.

iii. Constants: -

 Constants in C refers to fixed values that do not change during the execution of a program. C support several types of constants.
a. Numerical Constants
i. Integer Constant
1. Decimal Constant
2. Octal Constant
3. Hexadecimal Constant
ii. Float Constant
b. Character Constants
i. Single Character Constant
ii. String Constant

Integer Constant: -

 An integer constant is a whole number without any fractional part. C has three types of integer constants.
Decimal Constant: - Decimal integers consists of digits from 0 through 9
Eg.: 34,900,3457,-978

Octal Constant: -

 An Octal integer constant can be any combination of digits from 0 through 7. In C the first digit of an octal number must be a zero(0) so as to differentiate it from a decimal number. Eg.: 06,034,-07564

Hexadecimal Constant:

 Hexadecimal integer constants can be any combination of digits 0 through 9 and alphabets from „a‟ through „f‟ or „A‟ through „F‟. In C, a hexadecimal constant must begin with 0x or 0X (zero x) so as to differentiate it from a decimal number. Eg:- 0x50,0XAC2 etc

Floating Constants (Real):

 Real or floating point numbers can contain both an integer part and a fractional part in the number. Floating point numbers may be represented in two forms, either in the fractional form or in the exponent form.
A float point number in fractional form consists of signed or unsigned digits including decimal point between digits. E.g:- 18.5, .18 etc.
Very large and very small numbers are represented using the exponent form. The exponent notation use the „E‟ or „e‟ symbol in the representation of the number. The number before the „E‟ is called as mantissa and the number after forms the exponent.
Eg.:-5.3E-5,-6.79E3,78e05

Single Character Constant: -

 A character constant in usually a single character or any symbol enclosed by apostrophes or single quotes. Eg.: ch=‟a‟
String Constant: - A sequence of character enclosed between double quotes is called string constant. Eg.: “Hello Good Morning”

iv) Punctuations: -

 23 characters are used as punctuations in C. eg: + _ / ; : > ! etc

v) Operators: -

 An operator is a symbol that tells the computer to perform certain mathematical or logical manipulation on data stored in variables. The variables that are operated as operands. C operator can be classified into 8 types.
i. Arithmetic Operators : + - * / %
ii. Assignment Operators : =
iii. Relational Operators: < > <= >= == !=
iv. Logical Operators:! && ||
v. Conditional Operators: ! :
vi. Increment & Decrement Operator : ++ --
vii. Bitwise Operator:! & | ~ ^ << >>
viii. Special Operator :

WHAT IS C LANGUAGE COMPONENTS


C Language Components

The four main components of C language are
1) The Character Set.
2) Tokens
3) Variables
4) Data Types


1) The Character Set :


 Character set is a set of valid characters that a language cab recognize. A character represents any letter, digit or any other sign.

* Letters           - A,B,C……Z or a,b,c …………z.

* Digits        -      0,1…………9

* Special Symbols        -      ~!@#$%^&.........

* White Spaces        -        Blank space, horizontal tab, carriage return,
new line, form feed.


2) Tokens: 

The smallest individual unit in a program is known as a token.
C has five tokens

i. Keywords
ii. Identifiers
iii. Constants
iv. Punctuations
v. Operators


i. Keywords:

 Keywords are reserved word in C. They have predefined meaning cannot changed. All keywords must be written in lowercase. Eg:- auto,long,char,short etc.

ii. Identifiers: -

 Identifiers refer to the names of variable, functions and arrays. These are user-defined names. An identifier in C can be made up of letters, digits and underscore. Identifiers may start with either alphabets or underscore. The underscore is used to make the identifiers easy to read and mark functions or library members.

iii. Constants: -

 Constants in C refers to fixed values that do not change during the execution of a program. C support several types of constants.
a. Numerical Constants
i. Integer Constant
1. Decimal Constant
2. Octal Constant
3. Hexadecimal Constant
ii. Float Constant
b. Character Constants
i. Single Character Constant
ii. String Constant

Integer Constant: -

 An integer constant is a whole number without any fractional part. C has three types of integer constants.
Decimal Constant: - Decimal integers consists of digits from 0 through 9
Eg.: 34,900,3457,-978

Octal Constant: -

 An Octal integer constant can be any combination of digits from 0 through 7. In C the first digit of an octal number must be a zero(0) so as to differentiate it from a decimal number. Eg.: 06,034,-07564

Hexadecimal Constant:

 Hexadecimal integer constants can be any combination of digits 0 through 9 and alphabets from „a‟ through „f‟ or „A‟ through „F‟. In C, a hexadecimal constant must begin with 0x or 0X (zero x) so as to differentiate it from a decimal number. Eg:- 0x50,0XAC2 etc

Floating Constants (Real):

 Real or floating point numbers can contain both an integer part and a fractional part in the number. Floating point numbers may be represented in two forms, either in the fractional form or in the exponent form.
A float point number in fractional form consists of signed or unsigned digits including decimal point between digits. E.g:- 18.5, .18 etc.
Very large and very small numbers are represented using the exponent form. The exponent notation use the „E‟ or „e‟ symbol in the representation of the number. The number before the „E‟ is called as mantissa and the number after forms the exponent.
Eg.:-5.3E-5,-6.79E3,78e05

Single Character Constant: -

 A character constant in usually a single character or any symbol enclosed by apostrophes or single quotes. Eg.: ch=‟a‟
String Constant: - A sequence of character enclosed between double quotes is called string constant. Eg.: “Hello Good Morning”

iv) Punctuations: -

 23 characters are used as punctuations in C. eg: + _ / ; : > ! etc

v) Operators: -

 An operator is a symbol that tells the computer to perform certain mathematical or logical manipulation on data stored in variables. The variables that are operated as operands. C operator can be classified into 8 types.
i. Arithmetic Operators : + - * / %
ii. Assignment Operators : =
iii. Relational Operators: < > <= >= == !=
iv. Logical Operators:! && ||
v. Conditional Operators: ! :
vi. Increment & Decrement Operator : ++ --
vii. Bitwise Operator:! & | ~ ^ << >>
viii. Special Operator :

Sunday, 12 January 2014

what is computer

Introduction to Computers:

A computer system consists of hardware and software. Computer hardware is the collection of physical elements that comprise a computer system. Computer software is a collection of computer programs and related data that provides the instructions for a computer what to do and how to do it. Software refers to one or more computer programs and data held in the storage of the computer for some purposes. Basically computer software is of three main types

1. Operating System The Operating System (OS) is an interface between the compute software and hardware. The most popular and latest operating systems include Windows XP, Mac, UNIX, Linux, Windows Vista, etc.

 2. Application Software The application software is widely used for accomplishment of specific and precise tasks which is a step ahead than the basic operations or running of the computer system. The application software includes printing documents, and permitting access to internet for web and video conferencing activities. The Application software indirectly does the interaction with the machine to perform all these functions. 

3. System Software System software directly interacts with computer hardware. Some of the examples are the device drivers for CPU, Motherboard, Mouse, Printer, Keyboard, etc. The system software takes the responsibility of control, integration and managing individual hardware machine of the computer


WHAT IS ALGORITHM IN C

Algorithm:

An algorithm is a description of a procedure which terminates with a result. Algorithm is a step-by-step method of solving a problem.

Properties of an Algorithm:

1) Finiteness: - An algorithm terminates after a finite numbers of steps.
2) Definiteness: - Each step in algorithm is unambiguous. This means that the action specified by the step cannot be interpreted (explain the meaning of) in multiple ways & can be performed without any confusion.
3) Input: - An algorithm accepts zero or more inputs
4) Output:- An algorithm should produce at least one output.
5) Effectiveness: - It consists of basic instructions that are realizable. This means that the instructions can be performed by using the given inputs in a finite amount of time.

Friday, 10 January 2014

HOW TO GET MORE LIKES IN FACEBOOK


How to Get More Facebook Likes for Your Website and Fan Page

Facebook Likes are a powerful way to get website visitors to socially engage with your brand. There are two types of likes you can solicit with Facebook’s developer code – likes for website pages and likes for your fan page. The best part is users can like both of these directly on your website without having to go anywhere else!

Using the Facebook Javascript SDK

Some features for the Facebook Like options are only available if you use the XFBML code for the buttons. In order to use XFBML, you must implement Facebook’s JavaScript SDK onto your website. It’s not just an additional line of code, however. You have to have an Application ID to use the JavaScript SDK.

Creating a Facebook Application for Your Website

So let’s look at creating an application on Facebook – it’s easier than you think!
Step 1: Create an App
To create an application for your website, you will want to start on the Create an App page and enter your site’s name, URL, and language.

Facebook Developer - Create an App

Click on the Create an App button to continue, and enter the captcha.
Step 2. Copy Your Application Data
On the following screen, you will get your App ID and Secret Key. Be sure to keep this handy as you will need it to implement some of the following Facebook Like code.



Facebook Developer Application Settings
You can also get it by visiting your Applications Dashboard at a later date.

Installing the JavaScript SDK on Your Website

 

Next, you will want to install the JavaScript SDK on your website using the code on the JavaScript SDK page.
Facebook Developer - JavaScript SDK Loading Code

There are two versions of the code as shown above – I personally go with the code under Loading the SDK Asynchronously as this option will make sure that, should the Facebook code not be responding, it will not hinder other objects from loading on your page, leading to faster page load times.
You will want to replace the text YOUR APP ID in either version with the App ID you generated earlier. Then place this code between your website’s <HEAD> </HEAD> tags. Depending on your CMS, you may need to place this in your header.php file or similar header template file.
Now that we have the JavaScript SDK covered, let’s move onto Facebook Like buttons.

Installing Facebook Like for Your Website Content

The general consensus is that Facebook Likes may influence search rankings. Whether it is direct, or just one among many other social indicators of good content is still debatable, but search engines nonetheless are taking cues from social signals. Hence, it can’t hurt to increase the likes of your website and its content.

How to Deal with Anxiety

Living is stressful, when you have to run from pillar to post to make ends meet, save up for a secure future and fulfill family responsibilities. And with stress comes anxiety, which ends up ruining your physical and mental health. The following steps will help you deal with anxiety and, with time, prevent it from getting worse.
1. Proper Diet: In the hustle-bustle of life, a proper sit-down meal is often neglected. When it comes to sound mental and psychological health, having the right kind of food will help keep mental anguishes at bay. A diet rich in magnesium and potassium is proven to stabilise hormonal levels and normalise anxiety. You must avoid caffeine and nicotine since they trigger anxiety rushes in the body.

2. Sleep Well: Your sleeping pattern suffers when you pay more attention to your professional life than your personal one. This, in turn, fails to provide the brain with adequate amounts of rest and thus causes stress. You should try and get at least 6 hours of sleep every day. Have dinner 3 hours before your assigned time to go to bed, and skip watching television before going to bed. Sleeping in a dark bedroom with no distractions will help you fall asleep easily. Sleeping well will let the mind and body heal and you can hope to enjoy better health.

3. Talk to People: Often talking about your feelings helps more than any other method. Seek a sympathetic listener and talk to them about your problems. Seek advice on how to overcome them. Having someone to listen to you will automatically release your pent-up anxiety. You will feel much lighter and refreshed afterwards.

 4. Exercise: Proper exercise often helps reduce stress levels. Since exercise improves blood circulation to the brain, you tend to feel less anxious at the end of the day. If, however, you do not feel like working out, you can choose to meditate as well. Meditation helps in calming your mind and refocusing attention to your outlook toward life. Practicing yoga also aids in mental health and does away with anxious thoughts. 5. Pamper Yourself: Often splurging on an expensive buy, or gorging on your favourite food help in reducing anxiety instantly. Go to a spa and let a good hot-oil massage invigorate you. Visit the mall and buy that jacket you have been coveting. Filling up the mind with positive and happy thoughts will reduce anxiety and keep you feeling normal all day.

 6. Think Positive: Having low self esteem is often the reason behind stress and anxiety. Negative thoughts trigger depression. Thinking positively, on the other hand, keeps one hopeful and expectant. Anxiety mostly arises from the dread of not meeting up to certain expectations. Getting rid of the dread and feeling confident will do wonders. This will help in keeping the negative thoughts away and lower your anxiety levels.
Anxiety is a product of pent-up stress and depression. Being unable to find an outlet for release can make this problem worse. However, by following these steps you can find ways to cope with it successfully. If these measures fail to help, seek the aid of a professional immediately.