Skip to main content

Posts

Recent Posts

Web Technology

File Handling In C

A file is a place on the disk where group of related data are stored.The data file always allows us to store information permanently and to access and alter the information whenever necessary.Or file can also be said as a system of bytes or characters stored contiguously in memory. Types of file: a)Text File b)Binary File Difference between text and binary file Text File Binary File 1.It consists of text in contrast to 1.It consists of information in ASCII form. binary form i.e. 0’s and 1’s. ...

Algorithm and Flowchart

Algorithm Algorithm is a set of instruction which will produce a solution to a given problem is executed in a specified sequence. An algorithm tells a person what to do next. Thus, an algorithm is a roadmap for solving a problem. The word 'algorithm' is named after a famous ninth century Arabic auther and mathematician Abu Jafar Mohammed Ibn Musa Al Khowarizmi. Advantages of Algorithm It is a step wise representation of a solution to a given problem, which makes it easy to understand. An algorithm uses a definite procedure. It is not dependent on any programming language, so it is easy to understand for anyone even without programming knowledge. Every step in an algorithm has its own logical sequences so it is easy to debug. Flowchart A flowchart is a graphical/ diagrammatic/ pictorial representation of series of instructions to be executed to perform a given task. It is a diagram or chart that shows the connections between different stags of process.  ...

Some Important C program using Pointer.

Pointer is a derived datatype in C and pointer variable is a special variable that holds the memory address or location of another variable(i.e. it point to another variable). Referencing a value through a pointer is called indirection or dereferencing . Declaration of pointer variable:-    A pointer variable is declared with an (*) operator before the variable name and is known as pointer or indirection or dereference operator. Syntax:-   data-type *pointer_variable_name;  e.g:-       int *ptr; Initialization:-     Every pointer variable contain garbage value before assignment of some valid address. So, pointer variable must be assigned with '0' or some valid address. void main ()  {   int a=10;   int *ptr;   ptr= &a;   printf(" a= %d ",a);   printf(" a=%d ",*ptr);  } Output:-   a=10   a=10    Below are some important C program using pointer:- > Ca...

Macros in C

The #define directive is specially used to define a micro i.e. single identifier that are equivalent to expression , complete statement or group of statements.       It is a fragment of code which has been given a name . Whenever the name is used , it is replaced by the contents of the macro. Syntax:-       #define macroname microexpansion Example:-  #define PI  3.14 #define ADD(a,b) (a+b) Predefined Macros in C Language Predefined                   Value     Macro __DATE__                  String containing the                                        current date __FILE__                   String containing the file name __LINE__          ...

Some Important C program using Recursive Function

The function that calling itself repeatedly until some specified condition is called Recursive function. For recursive function , following two conditions must be satisfied. i) The problem must be defined or written in terms of precious result. ii) There must be stopping condition. Below are the some important C program using recursive function:- >  C program to find factorial of a number using recursive function. >  C program to find the sum of 'n' natural number using recurrence function. >  C program to find the sum of digits of a number using recursive function. >  C program to generate fibonacci series upto nth term using recursive function. >  C program to solve tower of hanoi problem using recursion. Some other important c program:- Important C program of 1D Array Important C program of Matrix(2D Array) Important C program of string Important C program using Function Click  Here  to download complete n...

Storage Class in C

Storage class is a concept In C which provides information about the variable's visibility ,lifetime and scope. Storage class tells about the following things of variable. i) Scope of variable ii) Initial value of variable iii) Storage location of variable iv) Life span of variable Types of storage class:- i) Automatic variables ii) External variables iii) Static variable iv)  Register variable Different types of storage class are explained in the table given below:- Properties / Types Auto Register Extern Static storage Memory CPU register Memory Memory Default initial value Garbage value Garbage Value 0(zero) 0(zero) scope Only within the block it is defined  Only to the block it is defined Within whole program Only within the block it is defined Life Till control remains within block in which variable is defined Same as auto As long as program executes Persist between different function call ...