Friday, 14 March 2014

Variables

Variables in C Programming


Variables may be the most fundamental aspect of any computer language. A variable is a space in the computer's memory set aside for a certain kind of data and given a name.
Variables are used so that the same space in memory can hold different values at different times.

Constant and Variables

Printf( ) function can be used to print constant number, and characters. For example:
void main ( )
{
printf("This is the number five: %d", 5);
}
Output
This is the number five: 5
printed the number 5 plugging it into the format specifier, %d,
of course this is not very useful, since we could more easily have written:
void main ( )
{
printf("This is the number five: 5");
}
To achieve the same result the power of computer language comes from the ability to use variable, which can hold many different values in program statement. Let's rewrite the program above to use a variable instead of a constant.
void main ( )
{
int num;
num=5;
printf("This is the number five: %d", num);
}
This program gives the same output as before, but is has achieved it in quite a different way. It creates a variabl num, assigns it the value 5, and then prints out the value contained in the variable. This program contains several new elements. in the first statement,
int num;
a variable is declared, it is given a name and a type (type int).
in the second statement,
num=5;
The variable is assigned a value. The assignment operator (=) is used for this purpose. 
In the third statement of the program, the variable name,num is used as one of the arguments of the printf( ).

Variable Definitions

The statement
int num;
is an example of a variable definition. The definition consists of the type, int, followed by the name of the variable, num. In a C program all variables must be defined. if you have more than one variable of a same type, you can define them all with one type name, separating the variable names with commas:
int pencils, books, notebooks;
When you define a variable , the compiler sets aside an appropriate amount of memory to store that variable. In the present case we've specified an integer variable, so compiler will set aside two bytes of memory to hold numbers from -32768 to 32767.

Variable Types

in our previous program we used integer data type, there are other variable types as well.
Most variable types are numeric but there is one that isn't numeric. the character type. 
A character variable value may be a letter or other character surrounded by single quotes. A character variable is one-byte memory space in which the character constants such as 'a' or 'A' can be stored. The type name for a character is char. Thus, to declare a character variable, called ch, you would use the statement:
char ch;
You already know about integers. For situations when the normal integer is too small, the long integer (type long or long int) can be used . It occupies four bytes of memory and can hold integers from -2,147,483,648 to 2,147,483,647.
There are also two kinds of floating point variables. Floating point numbers are used to represent values that are measured like the height of a person(5 feet 6 inches). Floating point variable type float occupies four bytes and can hold numbers from about 1038 to 10-38 .
A double precision floating point variable, type double, occupies eight bytes and can hold numbers from 10308 to 10-308.
Another variable type, short is a two byte integer just like int and therefore is seldom used.
The Character type and Integer types also have unsigned versions (type unsigned char, unsigned int and unsigned long) which change the range of numbers the type can hold. For instance the unsigned int  type holds numbers from 0 to 65,535 rather than from -32768 to 32767.

Initializing Variables

It is possible to combine a variable definition with an assignment operator so that a variable is given a value at the same time its's defined for example;
int event=5;




Read More

Thursday, 13 March 2014

Basic Skills in Windows XP

Windows XP

What Is Booting Up?

Booting up is a term for starting your personal computer. It initiates an automatic routine that clears the memory, loads the operating system, and prepares the computer for use. 

What Should You See On The Screen After The Start-Up?

After the start-up, what you should see on the monitor is the Windows Desktop. It is the home base like the physical desk where your computer sits. Several tools to get you started are placed on the background area. These include a taskbar, icons, and a Start button. There will be variations from computer to computer on what the Desktop looks like. 

What Is A Window?

A window is a framed region on your screen. It is a rectangular pane with information in it. Once you have selected an option from a menu, another window appears. We call that, opening a window. Most windows contain icons on which you can click to activate a program. 

Recognizing The Parts Of A Window

Each window has a title bar at the top. It usually has the program name and the name of the document displayed in it. 
The menu bar is located directly under the title bar. It displays a list of command categories. In each category of commands, there are a number of choices. 
The toolbar is usually located under the menu bar. It displays a row of buttons for giving commands. 

What Are The Mouse Functions?

•Pointing. Move the mouse over the mouse pad until the pointer is in the pot where you want it. The pointer will move in the same direction that you move the mouse.
•Clicking. To click something, point at it and quickly press and release the left mouse button. 

•Double-clicking. Point and quickly click the mouse button in rapid succession twice. Double clicking is also used to initiate action.
•Dragging. To drag, place the mouse pointer where you want to start the drag, press and hold down the mouse button, and then drag the mouse to the ending spot. When you have completed the drag, release the mouse button. Dragging allows you to select text, to move items, and to perform other tasks. 

What Is The Taskbar?

The taskbar is the bar at the bottom of the Desktop. 
Task buttons appear on the taskbar to identify any open applications or programs currently being used. 
If a program is minimized (meaning it does not appear on the screen, but is still being used), clicking on it from the taskbar brings it back onscreen. You can easily switch to a different window by clicking its button on the taskbar. 

What Is The Start Button?

The Start button is the button that takes you almost anywhere in Windows. It is located on the taskbar. Clicking on the Start button brings up a single menu from which many menus and programs can be accessed. 

To display the Start menu, click the Start button. You see the following sub-menus 
Programs - View a list of your programs.
Documents - Open a recently opened document. 
Settings - Modify desktop or system settings. 
Search - Search for files or folders. 
Help and support- Get answers to your questions. 
Run - Open items such as Web pages, programs, and other computer sources. 
Log Off - Log off a Windows session. 
Turn off computer - Shut down or restart your computer. 

How Do I Shut Down The PC?

Before you shut down, always save the files you are working on. Always close Windows before shutting down your computer. This will help to protect your files from data corruption. 
To shut down:
• Click the Start button and select Turn off computer. 
• Select the Turn off option. 

How Do I Re-Start The PC?

• Click the Start button and select the Turn off button. 
• Select the Restart the Computer button. 
Try the alternate method. 
• Press these three keys at the same time: Ctrl Alt Delete 
Read More

Sunday, 9 March 2014

Editing Documents in MS Word 2007

Editing Documents in MS Word 2007

Inserting Text 

To enter text, just start typing, the text will appear where the cursor is blinking. Move the cursor by using the arrow buttons on the keyboard or positioning the mouse and clicking. The keyboard shortcuts listed below are useful when moving through the text of a document.

Move Action                  Keystroke
Beginning of the line          Home
End of the line                  End
Top of the Document       Ctrl+Home
End of the Document       Ctrl+End

Selecting Text

To change any attributes of, it must be selected first, select the text by dragging the mouse over the desired text while keeping the left mouse button depressed, or hold down the Shift key on the keyboard while using the arrow buttons to highlight the text. the following list contains keyboard shortcuts to select a portion of text:

Select                              Technique
Whole word                     double click on the word
Whole paragraph              triple click within the paragraph
Several words or lines       drag the mouse over the words with left button pressed or hold down Shift key                                              while using the arrow keys.
Entire document                choose Editing-Select-Select All from the Ribbon, or press Ctrl+A

Inserting Additional Text 

  • Copy-Paste: Highlight the text you wish to copy and right click and click Copy, put your cursor where you want the text in the document and right click and click Paste.
  • Cut-Paste: Highlight the text you wish to move and right click and click Cut, put your cursor where you want the text in the document and right click and click Paste.
  • Drag Text: Highlight the text you wish to move, select and drag it to the place where you want the text in the document.

Deleting Blocks of Text

Use the Backspace and Delete keys on the keyboard to delete text, Backspace will delete text to the left of the insertion point while Delete will erase text to the right. To delete a large selection of text, select text and press Delete key.

Search and Replace Text

To find a particular word or phrase in a document:
  • Click Find on the Editing Group on the Ribbon.
  • Type that particular word in Find What and press Enter.
  • To replace that word with another, click on Replace Tab of the Find and Replace Dialog Box and type another word in Replace With and click Replace.

Undo and Redo

If you need to cancel your last actions in a MS Word document use Undo button and if you want to cancel last Undo action then use Redo button both buttons are available on Quick Access Toolbar.

Read More