Pages

Friday, 19 March 2021

History of “C” language & Flow Charts:

 C was developed at AT and T  Bell laboratories by Dennis Ritchie in year 1972 .The following sequences evolved in discovery of “c” .

 ALGOL (Algorithm Oriented Language) 1960

CPL (Combined Programing Language)  1963

BCPL(Basic Combined Programming Language) 1967

B(B Language) 1970

C(C language) 1972

Characteristics of ”C”

1. It is better than “B” as it is more friendly .

2. It is portable.

3. It is case sensitive.(i.e a case-sensitive language which simply means that a variable named as X and a variable named x are two separate variables. If it would have been a non case-sensitive language, than the both X and x would have referred to a single variable.)

Versions of “C”

1. Turbo C developed by Borland International .

2. ANSI “C” is developed by American National Standard Institutes.

3. Microsoft C developed by Microsoft Cooperation .

Flow Charts:

A flow chart is a pictorial representation of an algorithm , it shows the logic of the algorithm and the flow of control.

Algorithm: Algorithm is a step by step outline of flowchart how to solve a problem

Program: Program is an implemented coding of a solution to a problem based on the Algorithm

Symbols used are shown in the following figures.


Example: Flowchart for Swapping two numbers using third variable:

Flowchart for Swapping two numbers using third variable

Example: Flowchart for Swapping two numbers without using third variable

Flowchart for Swapping two numbers without using third variable

Example: Flow chart to find the largest of two a, b numbers

Example: Flow chart to find the largest of three a, b and c numbers    



Characteristic & Hierarchy Storage of a Computer:

The following are some of the important Characteristic of a Computer: 

1.Speed 

2.Accuracy

3.Storage capacity

4.Reliability

5.Variability

6.Cost benefits

7.Automatic.

1.Speed:

A Computer is a very fast device . The amount of work that a human being can do in an entire day can be performed by a computer in few seconds .The speed of the computer is measured in micro seconds and Nano seconds (10 -9) and Pico seconds (10 -12) . A powerful computer is capable of performing several billion athematic observations per second  .

2.Accuracy:

A computer is a very accurate device the accuracy of a computer is very high computer is error free as  computer is  high enough to avoid any errors

3.Storage capacity:

The basic properties of the Pre computers Era was the storage of the data which requires large amount of papers storage papers .The computer has solved this problem by providing space for storing large volume of data in small storage which has the capacity to store huge amount of data.

4.Reliability:

The output generated by the computer is very reliable to the extent that the input is reliable.

5.Versatility:

The computer performs three basic operations:

1. It accepts information from the user

2. It performs basic arithmetic and logical operations on the data as desired

3.It generates the desired output in the desired form.

6.Cost benefits:

Various benefits like performing at a high speed ,accurate calculations, large data storage supporting decision making and repeated performance of the same task.

7.Automatic:

Computer is a device which is more than a calculator, once the instructions given to the system it works automatically without any intervention until  completion of a program or until it means to the terminating of the job.

8. Weakness of computers:

1.No thinking and no decision making power.

2. No IQ.

Hierarchy Storage







Thursday, 18 March 2021

Types Of Computers

 



A)Classified by its Purpose.
There are 3 main categories :-
1. Analog 
2.Digital 
3.Hybrid computers 

1.ANALOG COMPUTERS:
Analog computers are the computers that measures physical quantities like pressure , temperature etc. 
The best example for an analog computer is a thermometer.

2.DIGITAL COMPUTERS:
Digital computers are the computers that are used for counting digital devices.
Eg: digital calculator, digital watch ( Seven segment display )

3.HYBRID COMPUTERS
The features of analog and digital machines are combined to create a hybrid computing system.
Eg. Analog Cardiogram.

B) Classified by its Size and Performance:
These are classified into four categories:
1.Super Computer
2.Main Frame Computer
3.Mini Computer
4.Micro Computer

1.SUPER COMPUTER:
       Complex scientific applications like weather forecast require a large amount of data to be manipulated within a very short time. 
Eg. CRAY Computers.

2.MAIN FRAME COMPUTER:
       These are very large computers with a very high capacity of storage , because they can process large amount of data very quickly. These systems are used by big companies , government departments.

3.MINI COMPUTER:
       Mini Computers are powerful than micro computers and can support several users. They have larger RAM (Random Access Memory) and backing storage capacity and can process data more quickly.
Eg. PDP (Programmed Data Processor)

4)Micro computer:
Micro computer are at the lowest end of the computer. The special purpose of using micro computer is to control washing machines.

C) Generations of Computer:
These are totally five generations known till today. They are given below
1.First Generation (1942-1955)
2.Second Generation (1955-1964)
3.Third Generation (1964-1975)
4.Fourth Generation (1975 Onwards)
5.Fifth Generation ( present and Future Generation )

1.First Generation(1942-1955):
In first generation computer, vacuum tubes were used as the main component. Due to the large size of vacuum tubes, these computers were very large in size with limited memory.
ex:1.ENIAC(Electronic Numerical Integrator And Calculator)
2.EDVAC(Electronic Discreet Variable Automatic Computer)
3.EDSAC(Electronic Delay Storage Automatic Calculator)

Features of First Generation computer:
1.Electronic circuitry used is vacuum tubes.
2.Slow operating speed, high electricity consumption and large heat generation.
3.Air conditioning required.
4.Continous maintenance was required.
5.Very bulky in size so unreliable and non-portable.
6.Limited programming capabilities i.e machine and assembly language.

2.Second Generation:- (1955-1964)
Second generation computers used transistors in place of Vacuum tubes, which were made up of semi- conductor material. The size of this computer is comparatively very small as compared to first generation computer due to the small size of transistors.
Example: IBM 7000 series and honey well 200 series.

Features of Second Generation computers:
1. Electronic circuits are used in transistors.
2. Due to their small size, they are more reliable and portable.
3. Computational time is in micro seconds  (10-6sec).
4. Less heat generated.
5. Required power to operate.
6. Faster than first generation.
7. Higher level languages were used.

3.Third Generation:- (1964-1975)
Integrated circuits are used here. On this chip, a very large number of components are integrated on very small surface. Due to this, the size of this generation computers is much smaller than first two generation computers
Example: IBM-360 series and ICL-1900 series

Features of Third Generation Computers:
1. The electronic circuit used in integrated circuits (IC)
2. Smaller in size
3. Increased speed and reliability
4. A very low heat generated
5. Computational time is reduced to Nano seconds
6. Maintenance cost is low and portable
7. Less power requirement
8. More advanced, high level languages like PASCAL, FORTRAN,COBOL, were used

4.Fourth Generation (1975 ONWARDS):
In this generation very large scale integrated circuits (VLSI) of about 5000 components on a single chip is used. so, the size is very small for this generation computers.
Example: IBM-370 and HP-3000.

Features of Fourth Generation Computers:
1. VLSI (very large scale integrated circuits) is the circuitry Used.
2. Smallest in size
3. Heart generated is minimum
4. Very reliable and much faster as compared to previous generations
5. No ago-conditioning required
6. Minimal maintenance required because hardware failure is negligible
7. Easily portable due to small
8. cheapest among all generations

5.Fifth Generation ( present and Future Generation ):
In The Generation , the main emphasis is on parallel processing and artificial intelligence to make the computers intelligent like human being . Here the  VLCI technology became ULSI ( Ultra Large Scale Integration Technology ) resulting in the production of micro processing chip having 10 million electronic components.
Ex: super computer 

Features of Fifth Generation Computers:
1.ULSI technology ( Ultra large scale integration ).
2.Availaibility of very powerful and compact computer at a very cheap rate .
3.Development of true artificial intelligence.
4.Advancement in super conductor technologies.
5.More use of friendly with multimedia features.

Friday, 26 February 2021

Block Diagram & History of Computer

In order to solve a problem on a computer, we should first evolve a detailed and  a precise step by step method of solving it such a method is called as “ALGORITHM”. 

An algorithm is expressed by using a precise notation is called “PROGRAM”. The precise notation itself is called “PROGRAMING LANGUAGE”. Thus a program is needed to solve a problem on a computer.

A COMPUTER (Commonly Operated Machine Particularly Used for Trade Education Research) is a machine that can perform computations. A computation involves the following 3 components shown in the figure, this architecture is commonly called as “NEUMANN ARCHITECTURE”.



1.INPUT DEVICE:

We can enter the data from the outside world into the primary storage as input programs through input devices. 

Example : Keyboard, Mouse etc..

2. OUTPUT DEVICE:

These are the devices that are used to output a computation according to our input.

Example: Display, Printers etc..

3.PROCESSING UNIT:

The CPU (Central Processing Unit) is the brain of the computing device and performs the basic processing steps a CPU typically consists of –

1.Contol Unit

2.ALU(Arthematic Logic Unit)

3.GPR(General Purpose Registrations) 

4.Storage unit

5.Bus

1.CONTROL UNIT:

The control unit (CU) controls all the activities or operations which are performed inside the computer system. This unit is responsible for controlling flow of data and instructions.

2.ARTHEMATIC LOGIC UNIT (ALU) :

The arithmetic and logical unit is the combinational digital electronic circuit that can perform arithmetic operations on integer binary numbers. The outputs of ALU will change asynchronously in response to the input. The basic arithmetic and bitwise logic functions are supported by ALU.

3.GENERAL PURPOSE REGISTRATIONS (GPR) :

A CPU usually consists of finite numbers of memory cells for storing intermediate results and values.

4.STORAGE UNIT:

A storage unit is classified into two categories 

1.Main or Primary memory

2.Secondary memory

1.MAIN OR PRIMARY MEMORY:

This is of a high-speed memory that stays close to the CPU programs are first loaded in the main memory and then executed usually, main memories are volatile.

Volatile: Loss of power leads to loss of data

 2.SECONDARY MEMORY:

This is a low-speed memory, normally meant for offline storage of programs and data usually, Secondary memories are non-volatile.

Non-Volatile: Loss of power never leads to loss of data

5. BUS:

A BUS is a set of wires that connect the set of above components, buses are responsible for the movement of data from the input device to the output device                           


 Components of Computer System


HISTORY OF COMPUTERS:

Essentially these are three types of calculating devices

1.Manual

2.Mechanical

3.Automatic

1.MANUAL:

The manual device was ABACUS. The abacus was invented around 600BC and In this device, the numbers are represented by the position of beads on a rack. By positioning the beads appropriately simple addition and subtraction is carried out rapidly and efficiently.

2.MECHANICAL:

The first mechanical adding machine was first invented by B. PASCAL in the year 1642. This machine has limited the computation of addition, subtraction, multiplication, and division were done on series of addition and subtraction respectively but the result was inaccurate and late.

3.AUTOMATIC:

In Automatic the following machines are used, they are

1.The MARK-1 computer was the first fully automatic calculating machine designed by Howard Aiken of Harvard University in collaboration with IBM it was very complex, huge, and very slow.

2.ENIAC machine (Electronic Numerical Integrator and Calculator)was designed by a team led by Prof J.P.Eckest & John Mauchly of the USA in 1943 . It is a Huge machine of 30 tonnes require around 18,000 Vaccum tubes performed about 5,000 additions per second and consumes 150-kilo watts of power and also requires big room for its placement.

3.EDVAC machine (Electronic Discrete Variable Automatic Computer) was designed on stored programs concept by John von Neumann. This machine was developed in 1946.

4.EDSAC machine (Electronic Delay Storage Automatic Calculator) was designed by Prof.M.Wikes at Cambridge University in 1947.

5.UNIVAC machine (Universal Automatic Computer)was installed firstly in Census Bureau in the year 1951.

Monday, 21 December 2020

GATE Questions

1)Program:

main()

{

int a=2,b=3;

printf("%d",++(a*b+1);

}

Output: compile time error

Explanation : -- / ++(expression) will not allow 


2)Program:

main()

{

int x=6;

if(x-6)

printf("welcome");

printf("%d",x);

else

printf("learner");

}

Output: error

Explanation : there is no braces for if condition 


3)Program:

main()

{

int x=6;

if(x-6)

   {

     printf("welcome");

     printf("%d",x);

   }

else

printf("learner");

}

Output: learner

Explanation : if (0) means condition false so it prints learner 


4)Program:

main()

{

float a=3.14;

printf("%f",a%2);

}

Output: compile time error

Explanation :   float will not support % operator 

 

5)Program:

int initializer (void)

{

 return 50;

}

int main()

{

 static int i=initializer();

 printf("value of i =%d",i);

 getchar();

 return 0;

Output: compile time error

Explanation :   In c static variables can only be initialized using constant literals

Thursday, 19 March 2020

Programs to illustrate operators

Operators:
We can define operators as symbols that help us to perform specific mathematical and logical computations on operands. In other words, we can say that an operator operates the operands.

For example :
consider the statement c = a + b;
Here, ‘+’ is the operator known as addition operator and ‘a’ and ‘b’ are operands. The addition operator tells the compiler to add both of the operands ‘a’ and ‘b’.

Operators are classified as follows:
  1. Arithmetic Operators
  2. Relational Operators
  3. Logical Operators
  4. Bitwise Operators
  5. Increment  Operators
  6. Decrement Operators
  7. Assignment Operators
  8. Ternary or Conditional Operators
  9. Special Operators

1.Arithmetic Operators ((5) : + ,  - ,  *  , %  , /):
These are the operators used to perform arithmetic/mathematical operations on operands. 
Examples: (+, -, *, /, %,++,–). 
Arithmetic operator are of two types:
Unary Operators: Operators that operates or works with a single operand are unary operators. For example: (++ , –)
Binary Operators: Operators that operates or works with two operands are binary operators. For example: (+ , – , * , /)

/* Program to illustrate 
Arithmetic Operators { (5) : +, -, *, %, / } */
#include<stdio.h>
#include<conio.h>
#include<process.h>
#define pf printf
#define sf scanf
void main()
{
int a,b,r;
clrscr();
pf("\n enter a value :");
sf("%d",&a);
pf("\n enter b value :");
sf("%d",&b);
r=a+b;
pf("\n Result is %d",r);
getch();
}

2.Relational Operators((6) : < , <= , > ,  >= , == , !=): 
These are used for comparison of the values of two operands.
For example, checking if one operand is equal to the other operand or not, an operand is greater than the other operand or not etc. Some of the relational operators are (==, !=, >= , <= , <, >)

/* Program to illustrate 
 Relational Operators { (6) : <,>,<=,>=,==,!= } */
#include<stdio.h>
#include<conio.h>
#include<process.h>
#define pf printf
#define sf scanf
void main()
{
int a,b,r;
clrscr();
pf("\n enter a value :");
sf("%d",&a);
pf("\n enter b value :");
sf("%d",&b);
r=(a<b);
pf("\n Result is %d",r);
getch();
}

NOTE: Relational operators can be used to combine more than one arithmetic expressions
for example : (a+b) >(c*d)

/* Program to illustrate relational operators can be used to combine more than one   arithmetic expressions */
#include<stdio.h>
#include<conio.h>
#include<process.h>
#define pf printf
#define sf scanf
void main()
{
int a,b,c,d,r;
clrscr();
pf("\n enter a value :");
sf("%d",&a);
pf("\n enter b value :");
sf("%d",&b);
pf("\n enter c value :");
sf("%d",&c);
pf("\n enter d value :");
sf("%d",&d);
r= (a+b)<(c*d);
pf("\n Result is %d",r);
getch();
}
 
OUTPUT:

3.Logical Operators ((3): && , || , !):  
Logical Operators are used to combine two or more conditions/constraints. The result of the operation of a logical operator is a Boolean value either true or false.

For example, the logical AND represented as ‘&&’ operator in C returns true when both the conditions under consideration are satisfied. Otherwise it returns false. 
Therefore, a && b returns true when both a and b are true (i.e. non-zero)

a

b

a &&b

0

0

0

0

1

0

1

0

0

1

1

1


For example, the logical OR represented as ‘||’ operator in C returns false when both the conditions under consideration are not satisfied. Otherwise it returns true. 
Therefore, a || b returns false when both a and b are false (i.e. zero)

a

b

a ||b

0

0

0

0

1

1

1

0

1

1

1

1

For example, the logical NOT represented as ‘|’ operator in C returns true for the given false condition similarly it gives false for the given true condition  
Therefore, if a is  true then the logical output  of a is false, similarly if a is false then the logical output is true

a

!a

0

1

1

0

/* Program to illustrate 
Logical Operators { (3) :  &&,   ||  ,  |   } */
#include<stdio.h>
#include<conio.h>
#include<process.h>
#define pf printf
#define sf scanf
void main()
{
int a,b,r;
clrscr();
pf("\n enter a value :");
sf("%d",&a);
pf("\n enter b value :");
sf("%d",&b);
r=(a&&b);
pf("\n Result is %d",r);
getch();
}

NOTE: Logical operators can be used to combine more than one relational expressions
for example : (a>b)&&(c<d)

/* Program to illustrate logical operators can be used to combine more than one relational expressions */
#include<stdio.h>
#include<conio.h>
#include<process.h>
#define pf printf
#define sf scanf
void main()
{
int a,b,c,d,r;
clrscr();
pf("\n enter a value :");
sf("%d",&a);
pf("\n enter b value :");
sf("%d",&b);
pf("\n enter c value :");
sf("%d",&c);
pf("\n enter d value :");
sf("%d",&d);
r=(a>b)&&(c<d);
pf("\n Result is %d",r);
getch();
}

OUTPUT:

4.Bitwise Operators ((6) : & , | , ^ , ~ , << , >>): 
The Bitwise operators is used to perform bit-level operations on the operands. The operators are first converted to bit-level and then the calculation is performed on the operands. The mathematical operations such as addition, subtraction, multiplication etc. can be performed at bit-level for faster processing. 

The following are the 6 Bitwise operators 
1.Bitwise AND (&) represented as & operator in C takes two numbers as operands and does AND gate function on every bit of two numbers. The result of AND is 1 only if both bits are 1.
For example:
  a  = 14 --------------1110     
  b  = 9    -------------1001
(Result a&b : 8) ---1000

2.Bitwise inclusive OR (|) represented as | operator in C takes two numbers as operands and does OR gate function on every bit of two numbers. The result of OR is 1 only if any one of the bits are 1.
For example:
  a  = 14  -------------1110     
  b  = 9    -------------1001
(Result a|b: 15)  ---1111

3.Bitwise exclusive OR ( ^) represented as ^ operator in C takes two numbers as operands and does x-OR gate function on every bit of two numbers. The result of OR is 1 only if any one of the bits are 1.
For example:
  a  = 14  -------------1110     
  b  = 9    -------------1001
(Result a^b: 7)  ---0111

4.Bitwise NOT(~) represented as ~ operator in C takes one number as operands and does NOT gate function  on every bit.
For example:
  a  = 14  -------------1110     
(Result ~a: -15)  ---1's complement is  0001 
To this result perform 2's complement i.e negative number 
  1110
+       1
---------
  1111 which is -15

For example:
  a  = 9  -------------1001     
(Result ~a: -10)  ---1's complement is  0110 
To this result perform 2's complement i.e negative number 
  1001
+       1
---------
   1010 which is -10
/*Program to illustrate 
Bitwise not( ~) and logical not (!) */
#include<stdio.h>
#include<conio.h>
#include<process.h>
#define pf printf
#define sf scanf
void main()
{
int a,b,bn,ln;
clrscr();
pf("\n enter a value :");
sf("%d",&a);
pf("\n enter b value :");
sf("%d",&b);
ln=(!a);
pf("\n Logical not '!': %d",ln);
bn=(~b);
pf("\n Bitwise not '~': %d",bn);
getch();
}
OUTPUT:

5.Bitwise right shift >> represented as >> operator in C takes one number as operands and does right shift one bit function  on every bit.
For example:
  a  = 9      -------------1001     
(Result a>>2: 2)  ---  0010

6.Bitwise left shift << represented as << operator in C takes one number as operands and does left shift one bit function  on every bit.
For example:
  a  = 9   --------------------1001     
(Result a<<2: 36)  --- 100100

/* Program to illustrate 
Bitwise Operators { (6) : >>, <<, &, |, ~ } */

#include<stdio.h>
#include<conio.h>
#include<process.h>
#define pf printf
#define sf scanf
void main()
{
int a,b,r;
clrscr();
pf("\n enter a value :");
sf("%d",&a);
pf("\n enter b value :");
sf("%d",&b);
r=(a&b);
pf("\n Result AND '&': %d",r);
r=(a|b);
pf("\n Result inclusive OR '|': %d",r);
r=(a^b);
pf("\n Result exclusive  '^': %d",r);
r=(~a);
pf("\n Result NOT '~': %d",r);
r=(a>>2);
pf("\n Result right shift '>>': %d",r);
r=(a<<2);
pf("\n Result left shift '>>': %d",r);
getch();
}

output:


5,6  Increment,
Decrement Operators (++ , -- ):
Both are useful operators generally used to minimize the calculation,
Operator   Description
++             Increment
−−             Decrement
i.e. ++x and x++ means x=x+1 or --x and x−− means x=x-1.
But there is a slight difference between ++ or −− written before or after the operand. Applying the pre-increment first add one to the operand and then the result is assigned to the variable on the left  whereas post-increment first assigns the value to the variable on the left and then increment the operand.
Example: 


/* Program to illustrate Increment and Decrement Operators */ 
#include <stdio.h>
void main()
{
    //set a and b both equal to 5.
    int a=5, b=5;
    //Print them and decrementing each time.
    //Use postfix mode for a and prefix mode for b.
    printf("\n%d %d",a--,--b);
    printf("\n%d %d",a--,--b);
    printf("\n%d %d",a--,--b);
    printf("\n%d %d",a--,--b);
    printf("\n%d %d",a--,--b);
}

Output:
5 4
4 3
3 2
2 1
1 0

7.Assignment Operators ((6) : =,+=,-=,*=,/=,%= ): 
Assignment operators are used to assign value to a variable. The left side operand of the assignment operator is a variable and right side operand of the assignment operator is a value. The value on the right side must be of the same data-type of variable on the left side otherwise the compiler will raise an error.

The following are the 
assignment operators {(6) : =,+=,-=,*=,/=,%= }

“=”: This is the simplest assignment operator. This operator is used to assign the value on the right to the variable on the left.
For example:
a = 10;
b = 20;
ch = 'y';
 
“+=”: This operator is combination of ‘+’ and ‘=’ operators. This operator first adds the current value of the variable on left to the value on right and then assigns the result to the variable on the left.
Example:
(a += b) can be written as (a = a + b)
If initially value stored in a is 5. 
Then (a += 6) 
        (a = a + 6) 
        (a = 11).

“-=”: This operator is combination of ‘-‘ and ‘=’ operators. This operator first subtracts the value on right from the current value of the variable on left and then assigns the result to the variable on the left.
Example:
(a -= b) can be written as (a = a - b)
If initially value stored in a is 8. 
Then (a -= 6)  
        (a = a - 6) 
        (a = 2).

“*=”: This operator is combination of ‘*’ and ‘=’ operators. This operator first multiplies the current value of the variable on left to the value on right and then assigns the result to the variable on the left.
Example:
(a *= b) can be written as (a = a * b)
If initially value stored in a is 5.
Then (a *= 6) 
        (a = a * 6) 
        (a = 30).

“/=”: This operator is combination of ‘/’ and ‘=’ operators. This operator first divides the current value of the variable on left by the value on right and then assigns the result to the variable on the left.
Example:
(a /= b) can be written as (a = a / b)
If initially value stored in a is 6.
Then (a /= 2) 
        (a = a / 2) 
        (a = 3)

“%=”: This operator is combination of ‘%’ and ‘=’ operators. This operator first divides the current value of the variable on left by the value on right and then assigns the result to the variable on the left.
Example:
(a %= b) can be written as (a = a % b)
If initially value stored in a is 6.
Then (a %= 2) 
        (a = a % 2) 
        (a = 0)

/* Program to illustrate Assignment operators */
#include<stdio.h>
#include<conio.h>
#include<process.h>
#define pf printf
#define sf scanf
void main()
{
int a;
clrscr();
pf("\n enter a value :");
sf("%d",&a); 
a-=8;  
pf("\n Result is %d",a);
getch();
}

8.Ternary or Conditional Operator (? :)
Conditional operator is of the form 
Expression1 ? Expression2 : Expression3 . 
If the condition (Expression1) is True then we will execute and return the result of Expression2 otherwise 
if the condition (Expression1) is false then we will execute and return the result of Expression3.
We may replace the use of if..else statements by conditional operators. 

/* Program to illustrate Ternary or Conditional operators */

#include<stdio.h>
#include<conio.h>
#include<process.h>
#define pf printf
void main()
{
int a=10,b=5;
clrscr();
(a>b) ? pf("\the value of a is %d",a) : pf("\the value of b is %d",b);
getch();
}

9.Special Operators: There are two special operators in c they are 

1. Sizeof operator: sizeof is a much used in the C programming language. It is a compile time unary operator which can be used to compute the size of its operand. Basically, sizeof operator is used to compute the size of the variable. 

2. Comma Operator: The comma operator (represented by the token ,) is a binary operator that evaluates its first operand and discards the result, it then evaluates the second operand and returns this value (and type). The comma operator has the lowest precedence of any C operator. Comma acts as both operator and separator.

* Program to illustrate sizeof and comma operators */
#include<stdio.h>
#include<conio.h>
#include<process.h>
#define pf printf
void main()
{
int x,a=10,b=5;
float r;
double q;
char p;
clrscr();
x=(a=10,b=5,a+b);
pf("\n The value of the given comma operator is %d",x);
pf("\n The number of bytes occupied by given data type is  %d",sizeof(p));
pf("\n The number of bytes occupied by given data type is  %d",sizeof(a));
pf("\n The number of bytes occupied by given data type is  %d",sizeof(r));
pf("\n The number of bytes occupied by given data type is  %d",sizeof(q));
getch();
}
OUTPUT:

Programs in turboc3 : Files

File Handling in C File Handling concept in C language is used for store a data permanently in computer. Using this concept we can store our...