.

get our extension

Wednesday 24 September 2014

Learn C Programming Lesson 8 - Functions

BY Unknown IN , No comments


Learn C Programming Lesson 8 - Functions

Functions are sub-programs. You have already been using a function which is the main function.

You must always declare a function before the function that calls it. The main function will be calling our function so we will put ours above main.

First put its return value such as int or char. If you don't want a return value then use void. After that give it a unique name and put a set of brackets after that. You then put the set of curly brackets which will have the sub-program between them. We will call our function Hello because it will simply print the word Hello on the screen.
#include

void Hello()
{
   printf("Hello\n");
}

int main()
{
   Hello();
   return 0;
}
PARAMETERS:

Parameters are values that are given to a function so that it can perform calculations with them. The "Hello\n" which we used in the Hello function is a parameter which has been passed to the printf function.

You need to declare variables inside the parameter brackets to store the values of the parameters that are passed to the function. Here is an Add function which adds the 2 parameters together and then returns the result.
#include

int Add(int a,int b)
{
   return a + b;
}

int main()
{
   int answer;
   answer = Add(5,7);
   return 0;
}
You can pass the address of a variable to a function so that a copy isn't made. For this you need a pointer.
#include

int Add(int *a,int *b)
{
   return *a + *b;
}

int main()
{
   int answer;
   int num1 = 5;
   int num2 = 7;
   answer = Add(&num1,&num2);
   printf("%d\n",answer);
   return 0;
}
Global And Local Variables:

A local variable is one that is declared inside a function and can only be used by that function. If you declare a variable outside all functions then it is a global variable and can be used by all functions in a program.

#include

// Global variables
int a;
int b;

int Add()
{
   return a + b;
}

int main()
{
   int answer; // Local variable
   a = 5;
   b = 7;
   answer = Add();
   printf("%d\n",answer);
   return 0;
}
Command-Line Parameters:

Sometimes you also pass parameters from the command-line to your program. Here is an example:

$ myprogram -A

To be able to access the command line parameters you have to declare variables for them in the brackets of the main function. The first parameter is the number of arguments passed. The name of the program also counts as a parameter and is parameter 0. The second parameter is the arguments in a string array.

#include

int main(int argc,char *argv[])
{
   int i;
   printf("Amount: %d\n",argc);
   if (argc > 0)
   {
      printf("Parameters:\n");
      for (i = 0;i < argc;i++)
         printf("%s\n",argv[i]);
   }
   return 0;
}

PREVIOUS                                              NEXT 

Learn C Programming Lesson 7 String

BY Unknown IN , No comments


Learn C Programming Lesson 7 - Strings

A string is an array of characters. Strings must have a 0 or null character after the last character to show where the string ends. The null character is not included in the string.

There are 2 ways of using strings. The first is with a character array and the second is with a string pointer.

A character array is declared in the same way as a normal array.
char ca[10];
You must set the value of each individual element of the array to the character you want and you must make the last character a 0. Remember to use %s when printing the string.
char ca[10];
ca[0] = 'H';
ca[1] = 'e';
ca[2] = 'l';
ca[3] = 'l';
ca[4] = 'o';
ca[5] = 0;
printf("%s",ca);
String pointers are declared as a pointer to a char.
char *sp;
When you assign a value to the string pointer it will automatically put the 0 in for you unlike character arrays.
char *sp;
sp = "Hello";
printf("%s",sp);
You can read a string into only a character array using scanf and not a string pointer. If you want to read into a string pointer then you must make it point to a character array.
char ca[10],*sp;
scanf("%s",ca);
sp = ca;
scanf("%s",sp);
String Handling Functions:
The strings.h header file has some useful functions for working with strings. Here are some of the functions you will use most often:

strcpy(destination,source)
You can't just use string1 = string2 in C. You have to use the strcpy function to copy one string to another. strcpy copies the source string to the destination string.
s1 = "abc";
s2 = "xyz";
strcpy(s1,s2); // s1 = "xyz"
strcat(destination,source)
Joins the destination and source strings and puts the joined string into the destination string.
s1 = "abc";
s2 = "xyz";
strcat(s1,s2); // s1 = "abcxyz"
strcmp(first,second)
Compares the first and second strings. If the first string is greater than the second one then a number higher than 0 is returned. If the first string is less than the second then a number lower than 0 is returned. If the strings are equal then 0 is returned.
    s1 = "abc";
    s2 = "abc";
    i = strcmp(s1,s2); // i = 0
strlen(string)
Returns the amount of characters in a string.
s = "abcde";
i = strlen(s); // i = 5

PREVIOUS                                                                                   NEXT

Sunday 14 September 2014

Learn C Programming Lesson 6 - Arrays

BY Unknown IN , No comments


Learn C Programming Tutorial Lesson 6 - Arrays

Up until now if you wanted to declare 5 variables you would have to do something like this:

int i1,i2,i3,i4,i5;

What if you wanted to declare 100 variables? That would take quite a long time. If you use an array on the other hand then you can declare as many variables as you want with only 1 variable name.

An array is declared in the same way as a normal variable except that you must put square brackets after the variable name. You must also put the amount of elements you want in the array in these sqaure brackets.

int a[5];

To access the value of an element of an array you must again use the square brackets but with the number of the element you want to access. When accessing an element of an array you must remember that they start from 0 and not 1. This means that an array which has 5 elements has an element range of 0 to 4.

int a[5];
a[0] = 12;
a[1] = 23;
a[2] = 34;
a[3] = 45;
a[4] = 56;
printf("%d",a[0]);

Using Arrays With Loops:

The most useful thing to do with an array is use it in a loop. This is because the element number follow a sequence just like a loop does.

When an array is declared the values are not set to 0 automatically. You will sometimes want to set the values of all elements to 0. This is called initializing the array. Here is an example of how to initialize an array of 10 elements using a for loop:

int a[10];
for (i = 0;i < 10;i++)
   a[i] = 0;

Multi-Dimensional Arrays:

The arrays we have been using so far are called 1-dimensional arrays because they only have what can be thought of a 1 column of elements. 2-dimensional arrays have rows and columns. Here is a picture which explains it better:






























You do get 3-dimensional arrays and more but they are not used as often. Here is an example of how you declare a 2-dimensional array and how to use it. This example uses 2 loops because it has to go through both rows and columns.

int a[3][3],i,j;
for (i = 0;i < 3;i++)
   for (j = 0;j < 3;j++)
      a[i][j] = 0; 

< PREVIOUS        START OVER        NEXT >


Wednesday 10 September 2014

Adding AdSense Widget In Blogger

BY Unknown IN , , 22 comments


Please Correct The Errors On This Form
OR
Fixing The Adsense Widget Error In Blogger 
If you are new to blogger and you have an adsense account, you might have faced this problem once or more than once. I was also troubled with this problem. I searched on Google many times, but nothing i found. Here is a screenshot !





















So , I did not give up and decided to find a solution by myself, hence I Got ! On Google I found only one solution that was HTML/JAVASCRIPT Widget. But I wanted to add an adsense widget. So finally I found a solution. Here is an solution. 

STEPS !

1) Login to your Blogger account.

2) Select your blog after logging in. In my case I will select my Blog which is ULTIMATE BLOG.









3) Click on Earning tab. 





















4) There you will see information about Adsense Account ! Here is a screenshot.













5) Click on YES , and if you have approved Adsense account on the same email account on which you are blogging. Then just click YES and follow the instructions. In case your account disapproved. you can create another Google account and can sign up for adsense account. When you have fully approved adsense account. Then You must have walkthrough  from these steps. Read On !














6) Click on Switch Adsense Account ! 

7)At next step you will be redirected to below page.



















Click on "Yes, Proceed to Google Account sign in"

8) At this step you have to log out from the existing Google account and sign in with the account you have an approved adsense account. Follow below instructions.





















9) Enter your login credentials of the approved adsense account and click Sign In !

10) Finally At this step you will be redirected to adsense widget page. There you will see a message that "Adsense Widget Has Been Added Automatically". Thats It !
 Its an easy, lengthy but a bit trickier method.
 Any Question ? Any Confusion ?
Leave A Comment Below










Tuesday 9 September 2014

Make Your Windows XP Genuine

BY Unknown IN , No comments


STEPS !
1)  Download it from the above link.
2) Extract It.
3) Open It.
4) Click Yes then click OK 
5) Restart your system and ENJOY ! 
THATS IT !


Monday 8 September 2014

10 Ways To Optimize Your PC Speed

BY Unknown IN , No comments


Top Ten Tips To Improve System Speed/Optimize System Speed

1) Let your PC boot up completely before opening any applications.

2) Refresh the desktop after closing any program. This will remove any unused files from the ram. 

3) Do not set a very large size of image as your wallpaper. I recommend do not keep a wallpaper if your system specifications are low or it runs slowly.

4) Do not clutter your desktop with a lot of shortcuts. Each shortcut on the desktop uses about 500 bytes of RAM.

5) Clean up/empty the recycle bin regularly. The files you deleted from hard drive are not actually yet deleted until you delete them from recycle bin.  

6)Make sure you delete internet temporary files regularly, as it can slow down your PC. I suggest use cleaner software like PC Cleaner Pro.

7) Defragment your hard once every two months. This will free up a lot of space and rearrange the files on your hard drive so that your applications run faster than usual. 

8) Always create two partitions in your hard drive. Install large file size of softwares(like PSP, 3Ds Max, Photoshop, Games) in secondary partitions not in OS installed partition. Windows uses all the available empty space in C drive as a Virtual Memory when your computer RAM is full. Keep the Drive C as empty as possible. 

9)When installing new softwares, disable the option of having a tray icon . The tray icoon uses available RAM, and also slow down the booting speed of your PC. Also disable the option of starting the application/program automatically when the PC boots up. You can disable these options later also from the tools preference or options menu in your program. 

10) Protect your PC from DUST. Dust causes the CPU Cooling Fan to jam and slow down thereby gradually heating up your CPU/Processor and thus effects the processing speed. Use compressed air to blow out any dust from CPU. NEVER USE VACUUM !
 Remember ! 
                        RAM IS THE WORKING AREA (DESKTOP) OF THE CPU. KEEP IT AS EMPTY AND CLUTTERED AS POSSIBLE. 


                         

Sunday 7 September 2014

Learn C Programming Lesson 5 - Pointers

BY Unknown IN , No comments


Learn C Programming Tutorial Lesson 5 - Pointers

What are pointers:

A pointer is a variable that holds a memory address. Because it holds a memory address it is said to be pointing to the value at that memory location. You can use a pointer in a certain way to get the value at the address to which it points.

Pointers can be either typed or untyped. A typed pointer points to a particular variable type such as an integer. An untyped pointer points to any data type.

To declare a pointer you must put a * in front of its name. Here is an examaple of how to declare a pointer to an integer and an untyped pointer:

int main()
{
   int *p;
   void *up;
   return 0;
}

You can put the address of an integer into a pointer to an integer by using the & operator to get the integer's address.

int main()
{
   int i;
   int *p;
   i = 5;
   p = &i;
   return 0;
}

You can access the value of the integer that is being pointed to by dereferencing the pointer. The * is used to dereference a pointer. Changing the value pointed to by the integer will change the value of the integer.

int main()
{
   int i,j;
   int *p;
   i = 5;
   p = &i;
   j = *p; //j = i
   *p = 7; //i = 7
   return 0;
}

Using pointers in the above way is just a long way of saying j = i. You will find out about much more useful ways to use pointers later on but for now it is only important that you have a basic idea of how they work.

NEXT LESSON NO #6

Report An Error Or Mistake !



Saturday 6 September 2014

Learn C Programming Lesson 4 - Loops

BY Unknown IN , No comments


Learn C programming tutorial lesson 4 - Loops

What are loops:

Sometimes you will want to do something a lot of times. An example would be printing a character at the beginning of each line on the screen. To do this you would have to type out 24 printf commands because there are 25 rows on the screen and the 25th row will be left blank. We can use a loop to do this for us and only have to type 1 printf command. There are 3 basic types of loops which are the for loop, while loop and do while loop.

The for loop:

The for loop lets you loop from one number to another number and increases by a specified number each time. This loop is best suited for the above problem because we know exactly how many times we need to loop for. The for loop uses the following structure:

for (starting number;loop condition;increase variable)
   command;
With loops you also have to put commands between curly brackets if there is more than one of them. Here is the solution to the problem that we had with the 24 printf commands:

#include

int main()
{
   int i;
   for (i = 1;i <= 24;i++)
      printf("H\n");
   return 0;
}
A for loop is made up of 3 parts inside its brackets which are separated by semi-colons. The first part initializes the loop variable. The loop variable controls and counts the number of times a loop runs. In the example the loop variable is called i and is initialized to 1. The second part of the for loop is the condition a loop must meet to keep running. In the example the loop will run while i is less than or equal to 24 or in other words it will run 24 times. The third part is the loop variable incrementer. In the example i++ has been used which is the same as saying i = i + 1. This is called incrementing. Each time the loop runs i has 1 added to it. It is also possible to use i-- to subtract 1 from a variable in which case it's called decrementing.

The while loop

The while loop is different from the for loop because it is used when you don't know how many times you want the loop to run. You also have to always make sure you initialize the loop variable before you enter the loop. Another thing you have to do is increment the variable inside the loop. Here is an example of a while loop that runs the amount of times that the user enters:

#include

int main()
{
   int i,times;
   scanf("%d",&times);
   i = 0;
   while (i <= times)
   {
      i++;
      printf("%d\n",i);
   }
   return 0;
}
The do while loop

The do while loop is the same as the while loop except that it tests the condition at the bottom of the loop.

#include

int main()
{
   int i,times;
   scanf("%d",&times);
   i = 0;
   do
   {
      i++;
      printf("%d\n",i);
   }
   while (i <= times);
   return 0;
}
Break and continue

You can exit out of a loop at any time using the break statement. This is useful when you want a loop to stop running because a condition has been met other than the loop end condition.

#include

int main()
{
   int i;
   while (i < 10)
   {
      i++;
      if (i == 5)
         break;
   }
   return 0;
}
You can use continue to skip the rest of the current loop and start from the top again while incrementing the loop variable again. The following example will never print "Hello" because of the continue.

#include

int main()
{
   int i;
   while (i < 10)
   {
      i++;
      continue;
      printf("Hello\n");
   }
   return 0;
}

NEXT LESSON NO 5

Report An Error Or Mistake !













Learn C Programming Lesson 3 - Decisions

BY Unknown IN , No comments


Learn C Programming Tutorial Lesson 3 - Decisions

The If Statement :
So far we have only learnt how to make programs that do one thing after the other without being able to make decisions. The if statement can be used to test conditions so that we can alter the flow of a program. The following example has the basic structure of an if statement:

#include

int main()
{
   int mark;
   char pass;
   scanf("%d",&mark);
   if (mark > 40)
      pass = 'y';
   return 0;
}

In the above example the user enters the mark they got and then the if statement is used to test if the mark is greater than 40. Make sure you remember to always put the conditions of the if statement in brackets. If the mark is greater than 40 then it is a pass.

Now we must also test if the user has failed. We could do it by adding another if statement but there is a better way which is to use the else statement that goes with the if statement.

#include

int main()
{
   int mark;
   char pass;
   scanf("%d" ,&mark);
   if (mark > 40)
      pass = 'y';
   else
      pass = 'n';
   return 0;
}

The if statement first tests if a condition is true and then executes an instruction and the else is for when the result of the condition is false.

If you want to execute more than 1 instruction in an if statement then you have to put them between curly brackets. The curly brackets are used to group commands together.

#include

int main()
{
   int mark;
   char pass;
   scanf("%d" ,&mark);
   if (mark > 40)
   {
      pass = 'y';
      printf("You passed");
   }
   else
   {
      pass = 'n';
      printf("You failed");
   }
   return 0;
}

It is possible to test 2 or more conditions at once using the AND (&&) operator. You can use the OR ( || ) operator to test if 1 of 2 conditions is true. The NOT (!) operator makes a true result of a test false and vice versa.

#include

int main()
{
   int a,b;
   scanf("%d" ,&a);
   scanf("%d" ,&b);
   if (a > 0 && b > 0)
      printf("Both numbers are positive\n");
   if (a == 0 | | b == 0)
      printf("At least one of the numbers = 0\n");
   if (!(a > 0) && !(b > 0))
      printf("Both numbers are negative\n");
   return 0;
}

Boolean operators:

In the above examples we used > and < which are called boolean operators. They are called boolean operators because they give you either true or false when you use them to test a condition. The following is table of all the boolean operators in c:


















The switch statement:

The switch statement is just like an if statement but it has many conditions and the commands for those conditions in only 1 statement. It is runs faster than an if statement. In a switch statement you first choose the variable to be tested and then you give each of the conditions and the commands for the conditions. You can also put in a default if none of the conditions are equal to the value of the variable. If you use more than one command then you need to remember to group them between curly brackets.

#include

int main()
{
   char fruit;
   printf("Which one is your favourite fruit:\n");
   printf( "a ) Apples\n");
   printf( "b ) Bananas\n");
   printf( "c ) Cherries\n");
   scanf( "%c" ,&fruit);
   switch (fruit)
   {
      case 'a':
         printf("You like apples\n");
         break;
      case 'b':
         printf("You like bananas\n");
         break;
      case 'c':
         printf("You like cherries\n");
         break;
      default:
         printf("You entered an invalid choice\n");
   }
   return 0;
}


NEXT LESSON NO 4

Report An Error Or Mistake 





Friday 5 September 2014

ESET Smart Security 5 Free Full Version Activated Download

BY Unknown IN No comments




New Look
  • Home Screen:     Quick links make important tools and features more readily accessible:



  • Figure 1-1
    Click the image to view larger in a new window
     

    • Advanced mode: All key features and configuration options are included in the new Graphical User Interface - you no longer have to toggle advanced mode.
       
    • Protection status icon: Now located in the upper right-hand corner of the main program window, the Protection status icon provides access to the main menu from any screen. 

    Breadcrumbs: When viewing a nested screen, breadcrumbs aid navigation by allowing you to jump back to a previous window.

    • Figure 1-2
      Click the image to view larger in a new window
     

    Parental control
    Exclusive to ESET Smart Security 5, Parental control allows parents to use their ESET security product to control what content their children have access to on the Internet. Key features of Parental control include:
    • Web content filter: Automatically selects appropriate web categories for easy setup and blocks or allows specific web pages and categories.
       
    • User Accounts: Create and manage user accounts with pre-configured and custom profiles based on the age and profile of the user (i.e. Parent, Teenager, Child and Custom).
       
    • Activity log: View a log of sites visited, whether those sites are allowed or restricted, and their time stamp.




















    Figure 1-3
    Click the image to view larger in new window


    ESET Live Grid
    ESET Live Grid is a new feature that speeds up scanning by utilizing a safe whitelist from ESET users in the cloud. By skipping files, folders and programs that are known to be safe, ESET Live Grid speeds up scan time and boosts system performance.
    • First time scans with a new virus signature database do not utilize the cloud whitelist
       
    • ESET Reputation System: Running processes are displayed along with their risk level and number of users in the cloud who are also running them




















                                                                                                      Figure 1-4
    Click the image to view larger in a new window


    Removable media control

    Removable media control gives you the ability to do the following:
    • Scan, block or adjust extended filters/permissions for removable media (CD/DVD/USB/...)
       
    • Control how a user accesses and works with a given device
       
    • Prevent the insertion of removable media containing unsolicited content 




















    Figure 1-5
    Click the image to view larger in a new window
    Gamer mode
    Gamer mode is designed to ensure that gaming and important presentations are not interrupted by your ESET security product.
    • System protection runs in the background without requiring user interaction
       
    • Pop-up windows are disabled
       
    • CPU usage by ESET is minimized
       
    • Scheduled ESET tasks are postponed
       





















    Figure 1-6
    Click the image to view larger in a new window

    HIPS

    Host-based Intrusion Prevention System (HIPS) protects your system from malware and unwanted activity attempting to negatively affect your computer.
    • Advanced behavioral analysis 
       
    • Uses network filtering to monitor running processes, files and registry keys
       
    • Actively blocks intrusion attempts
       
    Anti-Stealth
    Anti-Stealth technology (enabled by default) protects your system from dangerous malware (such as rootkits) that are designed to hide themselves from your operating system. For more information on rootkit detection, refer to the following Knowledge base article: 













    Figure 1-7
    Click the image to view larger in a new window


    Automatically check for product updates
    ESET Smart Security 5 and ESET NOD32 Antivirus 5 can be configured to check regularly for the latest product version automatically.