Programming in C – Overview
Brief History of C The C programming language is a structure oriented programming language, developed at Bell Laboratories in 1972 by Dennis Ritchie. C programming Read More »
Brief History of C The C programming language is a structure oriented programming language, developed at Bell Laboratories in 1972 by Dennis Ritchie. C programming Read More »
The structure of a C program is a protocol (rules) to the programmer, which he has to follow while writing a C program. The general Read More »
Source File- This file contains the source code of the program. The file extension of any c file is .c. The file contains C source Read More »
Every language has some basic elements & grammatical rules. Before starting with programming, we should be acquainted with the basic elements that build the language. Read More »
Variables are names that are used to store values. It can take different values but one at a time. A data type is associated with Read More »
When we are saying Input that means we feed some data into program. This can be given in the form of file or from command Read More »
Data can be entered & displayed in a particular format. Through format specifications, better presentation of results can be obtained Variations in Output for integer Read More »
An operator is a symbol that tells the compiler to perform specific mathematical or logical manipulations. C language is rich in built-in operators and provides Read More »
In C, ++ and – are called increment and decrement operators respectively. Both of these operators are unary operators, i.e, used on single operand. ++ Read More »
Operator precedence determines the grouping of terms in an expression. This affects how an expression is evaluated. Certain operators have higher precedence than others; for Read More »
In C, programs are executed sequentially in the order of which they appear. This condition does not hold true always. Sometimes a situation may arise Read More »
while statement The while statement is used when the program needs to perform repetitive tasks. The general form of a while statement is: while ( Read More »
The break Statement The break statement provides an early exit from for, while, and do, just as from switch. A break causes the innermost enclosing Read More »
MONOLITHIC VS MODULAR PROGRAMMING: Monolithic Programming indicates the program which contains a single function for the large program. Modular programming help the programmer to divide Read More »
There are four main categories of the functions these are as follows: 1. Function with no arguments and no return values. 2. Function with no Read More »
Actual Arguments: 1. Arguments which are mentioned in the function in the function call are known as calling function. 2. These are the values which Read More »
Recursion is a process in which a problem is defined in terms of itself. In ‘C’ it is possible to call a function from itself. Functions Read More »
Every repetitive problem can be implemented recursively or iteratively Recursion should be used when the problem is recursive in nature. Iteration should be used when the problem Read More »
To completely define a variable one needs to mention its type along with its storage class. In other words we can say not only variables have Read More »
Introduction A data structure is the way data is stored in the machine and the functions used to access that data. An easy way to Read More »
Arrays that we have considered up to now are one dimensional array, a single line of elements. Often data come naturally in the form of Read More »
1-d arrays using functions Passing individual array elements to a function We can pass individual array elements as arguments to a function like other simple variables. Read More »
A string is a series of characters treated as a single unit. A string may include letters, digits and various special characters such as +, -, Read More »
strcpy(): It is used to copy one string to another string. The content of the second string is copied to the content of the first string. Read More »
Definition A Structure is a user defined data type that can store related information together. The variable within a structure are of different data types and Read More »
The structure that contains another structure as its members is called a nested structure or a structure within a structure is called nested structure. The structure Read More »
Union is a collection of variables of different data types, in case of union information can only be stored In one field at any one time. Read More »
A pointer is a variable that contains the address of a variable. Pointers are much used in C, partly because they are sometimes the only way Read More »
In C, there is a strong relationship between pointers and arrays, strong enough that pointers and arrays should be discussed simultaneously. Any operation that can be Read More »
If p is a pointer to some element of an array, then p++ increments p to point to the next element, and p+=i increments it to Read More »
How to declare a pointer to a function? Syntax: returntype_of_function (*pointer variable)(List of arguments); For example: int (*p)(int,int); can be interpreted as p is a pointer Read More »
The memory allocation that we have done till now was static memory allocation.. So the memory that could be used by the program was fixed. Read More »
You may recall that the name of an array stands for the address of its zero-th element. Also true for the names of arrays of structure Read More »
A File is a collection of data stored on a secondary storage device like hard disk. File operation is to combine all the input data into Read More »
A digital system is a combination of devices designed to manipulate logical information or physical quantities that are represented in digital form; that is, the Read More »
Why Binary? The number system that you are familiar with, that you use every day, is the decimal number system, also commonly referred to as Read More »
BOOLEAN CONSTANTS AND VARIABLES Boolean algebra differs in a major way from ordinary algebra because Boolean constants and variables are allowed to have only two Read More »
The two principal characteristics of a computer are: It responds to a specific set of instructions in a well-defined manner. It can execute a prerecorded Read More »
Microcomputer Organization: The basic components of a microcomputer are: 1) CPU 2) Program memory 3) Data memory 4) Output ports 5) Input ports 6) Clock Read More »
FUNDAMENTALS OF PROGRAMMING: A microprocessor is an integrated circuit that serves as the central processing unit (CPU) of a computer. It is a programmable device Read More »
IO Interfacing INPUT/OUTPUT Techniques In all process content applications, Microprocessor would like to communicate with different I/O devices for data transfers is transfer of data between Read More »
INSTRUCTION FORMAT: All instruction of 8085 are 1 to 3 bytes in length .the bit pattern of the first cycle is the op code. The Read More »
An instruction set is a group of commands for a CPU in machine language. The term can refer to all possible instructions for a CPU Read More »
8085 interrupt structure There are five interrupt input TRAP,RST 75,SRT 65,RST 55 and IWTR. TRAP is a nonmaskable interrupt, that is, it cannot be disabled by an Read More »
Synchronous data transfer Synchronous means “at the same time”.The device which sends data and the device which receives data are synchronized with the same clock.When Read More »
INTERRUPT I/O TRANSFER This is a device initiated Microprocessor controlled I/O transfer. A Microprocessor may be communicating other time. In the case of CPU initiated Read More »
DMA D.M.A stands for direct memory access.D.M.A is also referred to as hardware controlled I/O, D.M.A is the only type of I/O transfer in which Read More »
Serial Input / Output data using 8085 8085 Microprocessor has two Serial Input/Output pins that are used to read/write one bit data to and from Read More »
Computer Organization and Architecture Computer technology has made incredible improvement in the past half century. In the early part of computer evolution, there were no Read More »
Overview of CPU Design The operation or task that must perform by CPU are: Fetch Instruction: The CPU reads an instruction from memory. Interpret Instruction: Read More »
To execute an instruction, the control unit of the CPU must generate the required control signal in the proper sequence. As for example, during the Read More »
Concept of Memory We have already mentioned that digital computer works on stored programmed concept introduced by Von Neumann. We use memory to store the Read More »
Input/Output Organization The computer system’s input/output (I/O) architecture is its interface to the outside world. Till now we have discussed the two important modules of Read More »
1- The NAND Gate as a Universal Logic Element The NAND gate is a universal gate because it can be used to produce the NOT, Read More »
What is mean by data structure ? Lets have brief introduction about data structure, Lets us takes an example ,in our room we have different Read More »
What is An Algorithm? An algorithm is a sequence of unambiguous instructions which can be used to solve the problem . In addition every algorithm Read More »
Overview of Recursion: A function must be able to call itself. For example, let us consider the function factr() shown below, which computers the factorial Read More »
Differences between recursion and iteration: Both involve repetition. Both involve a termination test. Both can occur infinitely. You may be interested in: Data Structures Read More »
Boolean Addition In Boolean algebra, a sum term is a sum of literals. In logic circuits, a sum term is produced by an OR operation with Read More »
in The Previous Post We have Learned What is algorithm? In Computer Science we have some problem which we have to solve, but before writing Read More »
In This section lets understand the Basic concept of NP Hard & NP Complete Algorithm NP-Hard and NP-Complete Problems An algorithm A is of polynomial Read More »
In this Post, the list data structure is presented. This structure can be used as the basis for the implementation of other data structures (stacks, Read More »
Overview In digital electronics, codes are used to represent information in a binary format. Parity is a technique used to detect errors in data transmission Read More »
Linked List Concepts A linked list is a non-sequential collection of data items. It is a dynamic data structure. For every data item in a Read More »
Arithmetic circuits are digital circuits designed to perform arithmetic operations on binary numbers. They are an essential component of digital systems, such as microprocessors, calculators, Read More »
The salient features of 8085 µp are: • It is a 8 bit microprocessor. • It is manufactured with N-MOS technology. • It has 16-bit Read More »
Overview of the main components The internal architecture of the 8086 microprocessor consists of various components that work together to execute instructions and process data. Read More »
Decoders and encoders are fundamental digital circuits used in digital electronics. They are designed to convert between different representations of data, such as binary codes, Read More »
Multiplexers A multiplexer or MUX, also called a data selector, is a combinational circuit with more than one input line, one output line and more Read More »
FLIPFLOPS The basic 1-bit digital memory circuit is known as a flip-flop. It can have only two states, either the 1 state or the 0 Read More »
Arithmetic and logic Unit (ALU) ALU is responsible to perform the operation in the computer. The basic operations are implemented in hardware level. ALU is Read More »
Single Linked List In Brief: A linked list allocates space for each element separately in its own block of memory called a “node”. The list Read More »
Main Memory The main working principle of digital computer is Von-Neumann stored program principle. First of all we have to keep all the information in Read More »
Paging Both unequal fixed size and variable size partitions are inefficient in the use of memory. It has been observed that both schemes lead to Read More »
Execution of a Complete Instructions: We have discussed about four different types of basic operations: Fetch information from memory to CPU Store information to CPU Read More »
Counting is frequently required in digital computers and other digital systems to record the number of events occurring in a specified interval of time. Normally Read More »
Another alternative is to allocate the nodes in blocks. In fact, if you know the maximum size of a list a head of time, you Read More »
REGISTERS A register is a group of binary storage cells capable of holding binary information. A group of flip-flops constitutes a register, since each flip-flop can Read More »
A double linked list is a two-way list in which all nodes will have two links. This helps in accessing both successor node and predecessor Read More »
READ-ONLY MEMORY (ROM) A read-only memory (ROM) is a device that includes both the decoder and the OR gates within a single IC package. The connections Read More »
General Definition of Operating Systems An OS is a program which acts as an interface between computer system users and the computer hardware. It provides Read More »
Operating System History It all started with computer hardware in about 1945s. Computers were using vacuum tube technology. Programs were loaded into memory manually using switches, Read More »
Overview: A process is an executing program, including the current values of the program counter, registers, and variables.The subtle difference between a process and a Read More »
Process States Overview: we have already read the concept of process ,not let us see what it is process states, please check the below figure Read More »
What is Scheduler in Operating System ? If we consider batch systems, there will often be more processes submitted than the number of processes that can Read More »
In order to achieve an efficient processor management, OS tries to select the most appropriate process from the ready queue. For selection, the relative importance of Read More »
Now, let’s discuss some processor scheduling algorithms again stating that the goal is to select the most appropriate process in the ready queue. For the Read More »
In a multi-programming system, in order to share the processor, a number of processes must be kept in memory. Memory management is achieved through memory management algorithms. Read More »
Why Paging is Required ? Paging permits a program to allocate noncontiguous blocks of memory. The OS divide programs into pages which are blocks of small Read More »
Every access to memory should go through the page table. Therefore, it must be implemented in an efficient way. a. Using fast dedicated registers Keep page Read More »
Concept Of Segmentation in Operating System In segmentation, programs are divided into variable size segments, instead of fixed size pages. Every logical address is formed of Read More »
Lets Discuss Virtual Memory Over here ,All the memory management policies we have discussed so far, try to keep a number of processes in the memory Read More »
If there is no page fault, effective access time is effective memory acces time is eatNO-PF = emat If there is a page fault, we Read More »
Why Dirty Bit? What is Dirty Bit? In order to reduce the page fault service time, a special bit called the dirty bit can be associated Read More »
A page replacement algorithm determines how the victim page (the page to be replaced) is selected when a page fault occurs. The aim is to minimize Read More »
Deadlocks Definition: In a multiprogramming system, processes request resources. If those resources are being used by other processes then the process enters a waiting state. However, Read More »
Resource allocation graphs are drawn in order to see the allocation relations of processes and resources easily. In these graphs, processes are represented by circles Read More »
Concept: It is just a single linked list in which the link field of the last node points back to the address of the first Read More »
Deadlock Prevention:To prevent the system from deadlocks, one of the four discussed conditions that may create a deadlock should be discarded. The methods for those conditions Read More »
Given some additional information on how each process will request resources, it is possible to construct an algorithm that will avoid deadlock states. The algorithm will Read More »
Banker’s Algorithm (Dijkstra and Habermann):It is a deadlock avoidance algorithm. The following data structures are used in the algorithm: m = number of resources n Read More »
If a system has no deadlock prevention and no deadlock avoidance scheme, then it needs a deadlock detection scheme with recovery from deadlock capability. For this, Read More »
If the system is in a deadlock state, some methods for recovering it from the deadlock state must be applied. There are various ways for recovery: Read More »
Processes frequently need to communicate with other processes. For example, in a shell pipeline, the output of the first process must be passed to the second Read More »
The problem of avoiding race conditions can also be formulated in an abstract way. Part of the time, a process is busy doing internal computations Read More »
Disabling Interrupts The simplest solution is to have each process disable all interrupts just after entering its CS and re-enable them just before leaving it. Read More »
By combining the idea of taking turns with the idea of lock variables and warning variables, in 1965, a Dutch mathematician, T. Dekker, was the Read More »
E. W. Dijkstra suggested using an integer variable for IPC problems. In his proposal, a new variable type, called a semaphore, was introduced. Dijkstra proposed having Read More »
Besides its usage for CS problem, semaphores can also be used for synchronization of the processes. For example consider two concurrent processes: p1, p2. We require Read More »
What is ADC ? An electronic integrated circuit which transforms a signal from analog (continuous) to digital (discrete) form. Analog signals are directly measurable quantities. Digital Read More »
Assume there are n slots capable of holding one item. Process producer will produce items to fill slots and process consumer will consume the items in Read More »
Imagine a big database, such as an airline reservation system, with many competing processes wishing to read and write. It is acceptable to have multiple processes Read More »
There are N philosophers spending their lives thinking and eating in a room. In their round table there is a plate of infinite rice and N Read More »
The barber shop has one barber, one barber chair, and N chairs for waiting customers, if any, to sit in. If there is no customer at Read More »
Sequential Logic Circuits Till now we studied the logic circuits whose outputs at any instant of time depend only on the input signals present at that Read More »
Starting with C++ How C++ evolved from C? The history of C++ begins with C. C++ is built upon the foundation of C. Thus, C++ Read More »
In the procedure oriented approach, the problem is viewed as the sequence of things to be done such as reading, calculating and printing such as Read More »
Here is an example of a complete C++ program: // The C++ compiler ignores comments which start with // double slashes like this, up to the Read More »
Built-in-type 1) Integral type : – The data types in this type are int and char. The modifiers signed, unsigned, long & short may be applied Read More »
Declaration of variables. C requires all the variables to be defined at the beginning of a scope. But c++ allows the declaration of variable anywhere Read More »
Assignment (=): The assignment operator assigns a value to a variable.a=5; This statement assigns the integer value 5 to the variable a. The part at Read More »
IF – ELSE STATEMENT The complete form of the if statement is if(expression) statement else statement where the targets of the if and else are Read More »
Advantages of OOP languages are: (i) OOP introduces the concept of data hiding & data encapsulation, because of which user is exposed to minimal data, Read More »
Class is a collective representation of a set of member variable and member function under one name. Structure is a collection of member variables and Read More »
It is a non-member function that can access the private members of the class to which it is declared as friend. According to OOP concept Read More »
What is class? Class is a collection of similar types of objects, where each class having similar properties and types. Ex: Bird, Animal Need of Read More »
Member functions: All the the declared functions and varibles are part of the class and hence members of the corresponding class. Those are declared and Read More »
Concept: A circular double linked list has both successor pointer and predecessor pointer in circular manner. The objective behind considering circular double linked list is Read More »
Static members Class members which are declared as static are known as Static members. Always Static variable shares same memory location. Syntax: Static int a; Read More »
One of the best feature that OOP provides is inheritance, where a new class can be constructed from an existing class. The class which is Read More »
Polymorphism Poly means many and morphism means form and this is a greek word. In OOP function overloading and operating are example of polymorphism. Polymorphism Read More »
A constructor (having the same name as that of the class) is a member function which is automatically used to initialize the objects of the Read More »
There are different type of constructors in C++ 1 Overloaded Constructors Besides performing the role of member data initialization, constructors are no different from other Read More »
The syntax for declaring a destructor is : -name_of_the_class() { } So the name of the class and destructor is same but it is prefixed Read More »
class to which it (the operator) is applied. The operator function helps us in doing so. The Syntax of declaration of an Operator function is as Read More »
C++ supports two complete I/O systems: the one inherited from C and the object oriented I/O system defined by C++ (hereafter called simply the C++ I/O Read More »
The classes istream and ostream define two member functions get(),put() respectively to handle the single character input/output operations. There are two types of get() functions.Both get(char Read More »
A line of text can be read or display effectively using the line oriented input/output functions getline() and write(). The getline() function reads a whole Read More »
When a large amount of data is to be handled in such situations floppy disk or hard disk are needed to store the data .The data Read More »
While using constructor for opening files,filename is used to initialize the file stream object. This involves the following steps Create a file stream object to Read More »
The function open() can be used to open multiple files that uses the same stream object. For example to process a set of files sequentially,in such Read More »
An S-R flip-flop has two inputs named Set (S) and Reset (R), and two outputs Q and Q’. The outputs are complement of each other, i.e., Read More »
The major disadvantage of doubly linked lists (over singly linked lists) is that they require more space (every node has two pointer fields instead of Read More »
Generally, synchronous circuits change their states only when clock pulses are present. The operation of the basic flip-flop can be modified by including an additional Read More »
Data structure Stack:There are certain situations in computer science that one wants to restrict insertions and deletions so that they can take place only at Read More »
An algebraic expression is a legal combination of operators and operands. Operand is the quantity on which a mathematical operation is performed. Operand may be Read More »
Combinational logic refers to a type of digital logic circuit in which the output depends solely on the current inputs. It doesn’t have any memory Read More »
A queue is another special kind of list, where items are inserted at one end called the rear and deleted at the other end called Read More »
A more efficient queue representation is obtained by regarding the array Q[MAX] as circular. Any number of items could be placed on the queue. This Read More »
In the preceding section we saw that a queue in which we insert items at one end and from which we remove items at the Read More »
Copyright © 2023 | ExamRadar. | Contact Us | Copyright || Terms of Use || Privacy Policy
GUEST POSTING AND WRITING FOR US