Friday, August 28, 2020

Detail of Software and Hardware

 Topic

 There are available only two things in computer system one is software and another is hardware.  Both is opposite of each other but cannot work without each other. Basically every person is known about computer because it is basic part of human. If you want to travel, you can use any website for online ticket, if any management is distributing salary to staff it will you payroll system, biometric for attendance sheet. Now a day computer is growing in every country. Here we will discuss only two topics one is software and another is hardware.

 Concepts

For learn more values and things about computer related topic we have to focus on these two basic topic software and hardware. Software is collection of many programs. Program is collection of many instructions for specified task. Software is not touchable things. It is no physical things. While hardware is opposite of software. You can easily touch the hardware like keyboard, monitor, mouse, printer etc.

Definition

Computer Hardware

Computer Hardware is any part of the computer that we can touch these parts. Computer Hardware is the primary electronic devices used to build up the computer. For example, monitor printer, keyboard, touchpad, joystick etc.

Computer Software

Computer Software is collection of many programs. Programs are collection of many instructions which is creating only specific task. For example, payroll software, MS-Office, Income tax software, Inventory Management Software etc. Computer Software is always two type (a) Application Software (b) System Software.

Explain

Computer Software is use for connect the people with the hardware machine. Any type of user can easily connect with the computer. User should not have any idea about computer programming / computer coding.  As we know computer software is two type one application software and system software.  System Software means operating system (like window), user can not connect with computer machine without the help of System Software.  Application Software is a platform for user so that user can work friendly.  Computer Hardware is tangible components. Computer Hardware is an electronic device which is provide the user’s basic platform. You can easily touch computer hardware for the work and computer software cannot be touch by user.

Example

 Computer Hardware

(1)Monitor

(2)Printer

(3)Keyboard

(4)Touch pad

(5)Mouse

(6)Hard Disk

(7)CD

(8) DVD

(9)Video Card

(10)Speaker

(11)Motherboard

(12)Central Processing Unit (CPU)

(13)Random Access Memory (RAM)

(14)External Hard Disk

(15)Headphone

(16)USB Flash Drive

(17)Projector

(18)Card Reader

(19)Hard Disk Drive (HDD)

(20)Optical Disc Drive (DVD Drive, CD Drive)

(21)Power Supply

 Computer Software

As we know computer software has two main parts one is System Software and Application Software.

System Software

 System Software is middle level to connect the user and machine. When you turn on the computer or laptop it will on system software. System Software is basic part of the computer. you cannot do the work without  the help of system software. Computer Hardware cannot understand the language of the human so that you cannot give any type of instructions to computer. If computer is not finding any type of instruction from human it will not work. So it is basic things.

Example

(1)Operating System

(2)Device Drivers

(3)Firmware

(4)Programming language Translators

(5)Utility

Application Software

The application software is also known as end-user programs or productivity programs are software that helps the user in specific task like online research, designing graphics , keeping an account log , or evening playing game. Application software is lie above the system software. System Software is use for the end user or the specific functionality or tasks.

 Example

(1)Word Processors

(2)Database Software

(3)Multimedia Software

(4)Education and Reference Software

(5)Graphics Software

(6)Web Browser

Different

There are lots of different between software and hardware:-




Saturday, August 15, 2020

Arrays in C language

So far we have used only the fundamental data types,namely char,int, float,double, and variations of the int and double.Although these types are very useful,they constrained by the fact that a variable of these types can store only one value at any given time. Therefore,they can be used only to handle limited amounts of data.In many applications,however,we need to handle a large volume of data in terms of reading,processing and printing. To process such large amounts of data, we need a powerful data type that would facilitate efficient storing.accessing and manipulation of data items. C supports a derived data type known as array that can ve used for such applications.

An Array is fixed-size sequenced collection of elements of the same data type. It is simply a grouping of like-type data. In its simplest form, an array can be used to represent a list of numbers, or list of names. Some examples where the concept of an array can be used:

·         List of temperatures recorded every hour in a day, or a month, or a year.

·         List of employess in an organization .

·         List of products and their cost sold by a store.

·         Test scores of a class of students.

·         List of customers and their telephone numbers.

·         Table of daily rainfall data.

and so on.

As we mentioned earlier, an array is a sequenced collection of related data items that share a common name. For instance, we can use an array name salary to represent a set of salaries of a group of employees in an organization. We can refer to the individual salaries by writing a number called index of  subscript in brackets after the array name. For example,

                  salary [10]

represents the salary of 10th employee. While the complete set of values is referred to as an array, individual values are called elements.

The ability to use a single name to represent a collection of items and to refer to an item by specifying the item number enables us to develop concise and efficient programs.For example,we can use a loop construct,discussed earlier, with the subscript as the control variable to readthe entire array,perform calculations, and print out results.

We can use arrays to represent not only simple lists of values but also tables of data in two, three or more dimensions. The following types of arrays:

·       1.  One-Dimensional Arrays.

·       2.  Two-Dimensional Arrays.   

·      3. Multi-Dimensional Arrays  

One-Dimensional Arrays  

A list of items may be given one variable name , and the individual elements may be accessed by the specification of their o their relative positions with respect to the start of the list.Like any other variable,arrays must be declared before they are used so that the compiler can allocate space for them in memory. The general form of array declaration is

        Type variable-name[size];

The type specifies the type of element that will be contained in the array,such as int,float or char and the size indicates the maximum number of elements that can be stored inside the array. For example,

        Float height[50];

declares the height to be an array containing 50 real elements. Any subscripts 0 to 49 are valid. Similarly,

         int group[10];

declares the group as an array to contain a maximum of 10 integer constansts. Remember:

·         Any reference to the arrays outside the declared limits would not necessarily cause an error. Rather, it might result in unpredictable program results.

·         The size should be either a numeric constant or a symbolic constant.

The C language treats character strings simply as arrays of characters. The size in a character string represents the maximum number of characters that the string can hold.For instance,

            char name[10];

declares the name as a character array(string) variable that can hold a maximum of 10 characters.      

Two-Dimensional Arrays

There could be situations where a table of values will have to be stored. Consider the following data table, which shows the value of sales of three items by four sales man:

 

Item 1

     Item 2

  Item 3

Salesman#1

       310

      275

  365

Salesman#2

       210

      190

  325

Salesman#3

       405

      235

  240

Salesman#4

       260

      300

  380

 The table contains a total of 12 values,three in each line. We can think of this table as a matrix consisting of four rows and three columns. Each row represents the values of sales by a particular salesgirl and each column represents the values of sales of a particular item.

Two-Dimensional arrays are declared as follows:

      type array_name[row_size][column_size]


Sunday, August 9, 2020

Operators in C languages

C supports a rich set of built-in operators. We have already used several of them,such as =,+,-,*,& and <. An operator is a symbol that tells the computer to reform certain mathematical or logical manipulations. Operators are used in programs to manipulate data and variables. They usually form a part of the mathematical or logical expressions.

C operators can be classified into a number of categories. They include:

1. Arithmetic Operators

2. Relational Operators

3. Logical Operators

4. Assignment Operators

5. Increment and Decrement Operators

6. Conditional Operators

7. Bitwise Operators

8. Special Operators

An expression is a sequence of operands and operators that reduces to a single value. For example,

10+15

Is an expression whose value is 25. The value can be any type other than void.

1.      1. Arithmetic Operators:-  C provide all the basic different operators. The operators +,-,*, and / all work the same way as they do in other languages. These can operate on any built-in data type allowed in C. The unary minus operator, in effect, multiplies its single operand by -1. Therefore, a number preceded by a minus sign changes its sign.

1.1 Integer Arithmetic:- When both the operands in single arithmetic expression such as a+b are integers, the expression is called an integer expression, and the operation is called integer arithmetic.  Integer Arithmetic always yields , and the operation is called integer arithmetic. Integer arithmetic always yields an integer value. The largest integer value depends on the machine, as pointed out earlier. In the above examples, if a and b are integers, then for a=14 1.1   and b=4 we have the following results:                                                                                            
              a-b=10

       a+b=18

       a*b=56

       a/b=3(decimal part truncated)

       a%b=2(remainder of division) 

1.   1.2 Real Arithmetic:-An arithmetic operation involving  only real operands is called real arithmetic. A real operand may assume values either in decimal or exponential  notation. Since floating point values are rounded to the number of significant digits permissible, the final value is an approximation of the correct result. If x,y, and z are floats, then we will have: x=6.0/7.0=0.857143,y=1.0/3.0=0.333333, z=-2.0/3.0=-0.666667. The operator % can not be used with real operands .

  1.3 Mixed-mode Arithmetic:-When one of the operands is real and the other is integer,the expression is called a mixed-mode arithmetic expression. If either operand is of the real type, then only the real operation is performed and the result is always a real number.Thus 15/10.0=1.5, whereas 15/10=1.

1.     2. Relational Operators:- We often compare  two depending  on their relation, take certain decisions. For example, we may compare the age of two persons , or the price of two items, and so on. These comparisons can be done with the help of relational operators.

1.      3.Logical Operators:- In addition to the relational operators. C has the following three logical operators.

            &&         meaning logical    AND

              ||           meaning logical    OR

              !              meaning logical    NOT

2.     4. Assignment Operators:- Assignment Operators are used to assign the result of an expression to a variable. We have seen the usual assignment operator,’=’ . In addition, C has a set of ‘shorthand ’ assignment operators of the form v op= exp; where  v is a variable, exp is an expression and op is a C binary arithmetic operator.

1.       5.Increment and Decrement Operators:- C allows two very useful operators not generally found in other languages. These are the increment and decrement operators:- ++ and – . The operator ++ adds 1 to the operand,while  -- subtracts 1. Both are unary operators and takes the following form:

             ++m;  or m++;

             --m;   or  m--;   

     6.    Conditional Operators:- A ternary operator pair “?:” is available in C to construct conditional expressions of the form:-  exp 1 ? exp 2: exp 3.  Where exp 1, exp 2, and  exp 3 are expressions.The operator  ? : works as follows  : exp 1 is evaluated first. If it is non zero(true), then  the expression exp 2  is evaluated and becomes the value of the expression. If exp 1 is false. exp 3 is evaluated and its value becomes the value of the expression. Note that only one of the expressions (either exp 2 and exp 3 )is evaluated. For example,consider the following statements.

                 a=10;

                 b=15;

                 x= (a>b)? a:b;   

In this example, x will be assigned the value of b. This can be achieved using the if..else statements as follows:

                If(a>b)

                 x=a;

                 else

                 x=b;

7. Bitwise Operators:-C has a distinction of supporting special operators known as bitwise operators for manipulation of data at bit level. These operators are used for testing the bits or shifting them right and left. Bitwise Operators may not be applied to float or double.


 8. Special Operators:- C supports some special operators of interest such as comma operator, sizeof operator, pointer operators(& and *) and member selection operators(. and ->).

8.1 The Comma Operators:- The comma operators can be used to link the related expressions together. A comma-linked list of expressions is evaluated left to right and the value of right-most expression is the value of the combined expression. For example, the statement value=(x=10, y=5,x+y);  first assigns the value 10 to x then assigns 5 to y  and finally assigned 15(i.e 10+5)to value . Since comma operator has lowest precedence of all operators, the parentheses are necessary. Some applications of comma operator are:

In for loops :

        for(n=1, m=10, n<m; n++, m++)

In while loops:

        While(c=getchar(), c!=’10’)

Exchanging Values

      t=x,x=y,y=t;

8.2 The sizeof Operator:- The sizeof is a compile time operator and, when used with an operand, it returns the number of bytes the operand occupies. The operand may be a variable, a constant or data type qualifier.

Examples: m=sizeof(sum);

                    n=sizeof(long int);

                    k=sizeof(235L);

The sizeof  operator is normally used to determine the lengths of arrays and structures when their sizes are not known to the programmer. It is also used to allocate memory space dynamically to variable during execution of a program . 




Wednesday, August 5, 2020

Concepts of Linked Lists in C language

We know that a list refers to a set of items organized sequentially. An array is an example of list. In an array, the sequential organization is provided implicity by its index. We use the index for accessing and manipulation of array elements . One major problem with the arrays is that the size of an array must be specified precisely at the beginning. As pointed out earlier, this may be a difficult task in many real-life applications.

A completely different way to represent a list is to make each item in the part of a structure that also contains a "link" to the structure containing the next item. This type of list is  called a linked list because it is a list whose order is given by links  from one item to the next.





Each structure of the list is called a node and consists of two fields, one containig the item, and the other containing the address of the next item(a pointer to the next item) in the list. A linked list is therefore a collection of structures ordered not by their physical placement in memory (like an array) but by logical links that are stored as part of the data in the structure itself. The link is in the form of a pointer to another structure of the same type.Such a structure is represented ads follows:

struct node

{

int item;

struct node *next;

} :

The first member is an integer item and the second a pointer to the next node in the list as shown below. Remember,the item is an integer here only for simplicity, and could be any complex data type.



 A node may be represented in general form as follows :

          Struct tag-name

         {

         type member1;

         type member1;

         ………

         ……..

         Struct tag-name *next;

         }

The structure may contain more than one item with different types. However, one of the items must be a pointer of the type tag-name.

Types of Linked Lists

There are different types of lined lists. The linked lists are as follows:-

(1)Linear Singly Linked Lists

(2)Circular Linked Lists

(3)Two-way or doubly Linked Lists

(4)Circular doubly Linked Lists


Monday, August 3, 2020

Pseudocode

Pseudocodes are a means to represent an algorithm in a coded form.The specifications used in a pseudocode are syntactically not stringent as in a program code. However, they represent the steps of an algorithm in a coded from which very closely resembles program code. Given a pseudocode,translation of the same into program code is relatively easy. A pseudocode may be considered to be an intermediate code between an algorithm and program code. The pseudocode for the algorithm in below example:-

Pseudocode SUMN

{

print "Enter a value for the number N: "

scan N

I=1

SUM = 0

while I <= N

{

SUM = SUM+I

I=I+1

}

print "The sum is: ",SUM

}  

It should be noted that a pseudocode is slightly more cryptic compared to an algorithm and is closer in form to a C program code. The C code for the pseudocode shown here would be as follows :-

#include<stdio.h>

Main()

{

Int I,SUM,N;

Printf(“\n Enter a value for the number N:”);

Scanf(“%d”, &N);

While(I <= N)

{

Sum=Sum+I;

I=I+1;

}

Printf(“\ The sum is: %d” , SUM);

}

A quick comparison between the pseudocode and the corresponding program using the C language shows that function names such as ‘printf’ and ‘scanf’ have replaced pseudocodes such as ‘print’ and ‘scan’. ‘print’ and ‘scan’ are codes would not be understood by the C compiler or the machine. Nevertheless, they are still in an encoded form. It is worth nothing that the statements in the C program are syntactically bound. However, such restrictions are not to be found in a pseudocode. 

HISTORY OF C LANGUAGE

'C' seems a strange name for a programming language. But this strange sounding language is one of the most popular computer languages because it is a structured,high-level,machine independent language. It allows software developers programs without worrying about the hardware platforms where they will be implemented.

In 1967, Martin Richards developed a language called BCPL(Basic Combined Programming Language)primarily for writing system software. In 1970, Ken Thompson created a language using many features of BCPL and called it simply B. B was used to create early versions of UNIX operating systems at Bell laboratories. Both BCPL and B were "typeless" system programming languages

C was evolved from ALGOL, BCPL and B by Dennis Ritchie at the Bell Laboratories in 1972. C uses many concepts from these languages and added the concept of data types and other powerful features. Since it was developed along with the UNIX operating system, it is strongly associated with UNIX. This operating system, which was also developed at Bell Laboratories, was coded almost entirely in C. UNIX is one of the most popular network operating systems in use today and the heart of the Internet data superhighway.

For many years, C was used mainly in academic environments, but eventually with the release of many C compilers for commercials use and the increasing popularity of UNIX. It began to gain widespread support among computer professionals. Today, C is running under a variety of operating system and hardware platforms.

During 1970s, C had evolved into what is now known as “traditional C”. The language became more popular after publication of the book ‘The C Programming Language’ by Brian Kerningham and Dennis Ritchie in 1978. The book was so popular that the language came to be known as “K&R C” among the programming community. The rapid growth of C led to developed of different versions of the language that were similar but often incompatible. This posed a serious problem for system developers.

To assure that the C language remains standard,in 1983, American National Standards Institute(ANSI) appointed a technical committee to define a standard for C. The committee approved a version of C in December 1989 which is now known ANSI C. It was then approved by the International Standards Organization(ISO) in 1990. This version of C is also referred to as C89.

During 1990’s,C++, a language entirely based on C, underwent a number of improvements and changes and became an ANSI/ISO approved language in November 1977. C++ added several new features to C to make it not only a true object-oriented language but also a more versatile language. 

SEE THE DIAGRAM


Detail of Software and Hardware

  Topic   There are available only two things in computer system one is software and another is hardware.   Both is opposite of each other...