Tuesday, December 4, 2018

Cloud

-The cloud is a term referring to accessing computer, information technology (IT), and software applications through a network connection
-Advantages:
  1. Cloud computing has many advantages. It’s often faster to provision the service
  2. Prevents data theft
  3. Flexible
  4. Reduces cost
  5. Increases mobility
  6. High sustainability
  7. Prevent loss of data
-Disadvantages:
  1. Weakness of shared technology
  2. Possible misuse
  3. Breach of privacy

Structure and Union

-A structure is a user-defined data type available in C that allows to combining data items of different kinds while a union is a special data type available in C that allows storing different data types in the same memory location.
-Similarities:
  1. Both are user-defined data types used to store data of different types as a single unit.
  2. Their members can be objects of any type, including other structures and unions or arrays. A member can also consist of a bit field.
  3. Both structures and unions support only assignment = and sizeof operators. The two structures or unions in the assignment must have the same members and member types.
  4. A structure or a union can be passed by value to functions and returned by value by functions. The argument must have the same type as the function parameter. A structure or union is passed by value just like a scalar variable as a corresponding parameter.
  5. ‘.’ operator is used for accessing members.
-Differences:
  1. In structure each member get separate space in memory.
  2. The total memory required to store a structure variable is equal to the sum of size of all the members.
  3. In union, the total memory space allocated is equal to the member with largest size. All other members share the same memory space. This is the biggest difference between structure and union.
  4. All the members can be initialized while declaring the variable of structure. Only first member can be initialized while declaring the variable of union.


Recursive Function

-A recursive function is a function that calls itself repeatedly until a condition is met.
-Recursion makes program elegant and more readable.
-Recursion is much slower than loops
How recursion works in C programming?

Wednesday, October 17, 2018

Repetition and looping

Program Control: Repetition 








-Repetition is the repetition of one or more instruction(s) for a certain period of time.

-The number of repetition can be predefined or post defined.
-Repetition/looping operation: for, while, do-while.
-The format of a For instruction is: 
for(exp1; exp2; exp3){
statement1;
statement2;  
…….
 }
-The format of a While instruction is:
while(exp){
statement1;
statement2;
…..
}
-The format of a Do-While instruction is:
do{
< statements >;
} while(exp);
-In while operation, statement block of statements may never be executed at all if exp value is false


-In do-while on the other hand statement block of statements will be executed min once
-break:
ending loop (for, while and do-while)
end the switch operation
-continue:
  -skip all the rest of statements (subsequent to the skip statement) inside a repetition, and continue normally to the next loop