Saturday, 29 March 2014

The If Statement in C

C Programming

Decisions in C

Computer languages must be able to perform different sets of actions depending on the circumstances. C has three major decision-making structures: the If statement, the If-Else statement, the Else-If statements and Switch statement.


The If Statement

C uses the keyword If to introduce the basic decision making statement, here is an example:

Program 
void main ( )
{
char ch;
ch=getche( );
if (ch = = 'a')
printf("\n you typed a.");
}

Output
a
you typed a

If you type 'a' the program will print "you typed a". If you type some other character then the program does nothing.

Multiple Statements with If

The body of the If Statement my consist of either a single statement or by a number of statements enclosed in braces. Here is an example:
void main ( )
{
     char ch;
     ch = getche ( );
     if ( ch = = 'a' )
         {
         printf("\n you typed a.");
         printf("\n not some other letter.");
         }
}

Output
a
you typed a.
not some other letter.

Nested If Statements

If statement can be nested like loops. Here is an example:

void main ( )
{
     if (getche ( ) = = 'n' )
          if ( getche ( ) = = 'o')
               printf("\n you typed no.");
}
In the above example, the inner if statement will not be reached unless the outer one is true, and the printf( ) statement will not be executed unless both if statements are true.






Read More

Friday, 28 March 2014

Do While Loop in C

C Programming










The last of the three loops in C is the Do While loop, which is very similar to the While loop-the difference is that in the do loop the test condition is evaluated after the loop is executed rather than before. Here is the program which prints the numbers from 0 to 9.


Program
void main ( )
{
int num=0; //initialization
do 
{
printf("Number is %d\n",num); // statements to be repeated
num++; // increment
}
while(num<10) // test
}



Output
Number is 0
Number is 1
Number is 2
Number is 3
Number is 4
Number is 5
Number is 6
Number is 7
Number is 8
Number is 9


The do loop, unlike the other loops, has two keywords: do and while. The do keyword marks the beginning of the loop; the while keyword marks the end of the loop 

in do loop, the body of the loop is first executed, the n the test condition is checked. if the test condition is true, the loop is repeated, if it is false , the loop terminates. the important point is that the body of the loop will execute at least once.
Read More

Wednesday, 26 March 2014

While Loop in C

C Programming

The second kind of loop structure available in C is the While Loop. Although at first glance this structure seems to be simpler than the for loop, it actually uses the same elements, but they are distributed throughout the program.

Let's try to compare the operations of for loop with while loop. The following program uses a while loop to produce the operation of our earlier for loop program, which printed the numbers from 0 to 9.

Program
void main ( )
{
int num=0;                      // initialization
while( num< 10)             // test
{
num++;                          // increment
printf("The Number is %d\n",num);   // statementws
}
}
Output
The Number is 0
The Number is 1
The Number is 2
The Number is 3
The Number is 4
The Number is 5
The Number is 6
The Number is 7
The Number is 8
The Number is 9

The unexpected Condition

The While loop is suited where a loop may be terminated unexpectedly by conditions developing within the loop.Consider the following program:
Program
void main ( )
{
int count=0;
printf)" Type in a phrase:\n");
while( getche( ) != ' \r ' )
count++;
printf("\n Chracter count is %d", count);
}

Output
Type in phrase:
boy
Character count is 3

The loop in this program terminates when the character typed at the keyboard is the [Return] key.
Lets look closely at the loop expression in the while loop:
while( getche( ) != ' \r ' )
This incorporates the function getche( ), returns the value of a character the instant the character is typed. As this function takes on or returns the value of the character typed so the function can be treated like a variable.








Read More

Monday, 24 March 2014

Microsoft Security Essentials

Security Software






Microsoft Security Essentials provides real-time protection for your home or small business PC against viruses, spyware, and other malicious software

Details

There are multiple files available for this download, Which are:
Version                                             File Size                         Bit
ENUS\ams64\MSEInstall.exe            13.0 MB                          64 Bit
ENUS\x86\MSEInstall.exe                10.6 MB                          32 Bit

Microsoft Security Essentials is a free download from Microsoft that is simple to download, install, easy to use, and always kept up-to-date so you can be assured your PC is protected by the latest technology.

Microsoft Security Essentials runs quietly and efficiently in the background so you are free to use your Windows based PC the way you want without interruptions or long computer wait times.

Before installing Microsoft Security Essentials, it is recommended to uninstall other antivirus software that can cause potentially conflicts that effect PC performance.

System Requirements

  • Windows 7, Windows Vista, Windows XP
Operating System: Windows XP Service Pack 3 (SP3) Windows Vista (Service Pack 1, or Service Pack 2) Windows 7
  • For Windows XP, a PC with a CPU clock speed of 500 MHz or higher, and 256 MB RAM or higher.
  • For Windows Vista and Windows 7, a PC with a CPU clock speed of 1.0 GHz or higher, and 1 GB RAM or higher.
  • VGA display of 800 × 600 higher.
  • 200 MB of available hard disk space.
Download








Read More