Wednesday, 11 September 2019

What is data structure?

Data is simply set of values . When the organized data is collected together is called data structure.
Data structure depends upon the organization of data, the data can be organized in many ways,
The logical or mathematical model of a special organization of data is also called data structure.
While organizing data, the structure should be simple enough that one can effectively process the data when necessary.
ADT(abstract data type) is a useful tool for specifying the logical properties of a data type. It is a well specified collection of data and a group of operations that can be performed upto the data.

The data structure are classified in the following two categories:
• Linear data structure
• Non-liner data structure

Linear data structure- In linear data structure data is processed sequentilly
one by one. It includes following types of data structure:
1.Array
2.Linked list
3.Stacks and Queues

Non-liner data structure- A data structure in which operation like insertion, deletion is not done in sequential fashion.
It includes following types of data structure:
• Graphs
• Tree
    

Sunday, 8 September 2019

How to write a program to find the factorial of given numbers?

#include<stdio.h>
#include<conio.h>
void main()
{
  int I, n, f;
  clrscr(); 
  printf("Enter the number ");
  scanf("%d",&n);
   While(i<= n)
   {
      f= f*i;
      i++
   }
  printf(" The factorial if the number is=% d\n",n, f);
getch();
}





What is register?

Register is just like a small memory they are used to store data or bit in binary form 0 and 1 .
A register is a group of flip-flop. Each flip-flop is storing one bit of information. We can use register to store the binary information there are many types of register are- :
1- Accumulator(ACC)
2- General purpose register
3- Pointer counter(PC)
4- Stack pointer(SP)
5- Instruction register
6- Temporary register
7- Index register
8- Instruction formate