Posts

Object Oriented Approach | C++ Programming

Image
Object Oriented Approach | C++ Programming                 The fundamental idea behind object-oriented language is to combine both data & function that separate data into a single unit such a unit is called object. A objects function called member function provides the way to access objects data.

Procedural Oriented Approach | C++ Programming

Image
Procedural Oriented Approach | C++ Programming In procedural oriented approach programs are organized in form of subroutines. The subroutines do not let the code duplication. P.O. is suitable for medium sized software C, Pascal, FORTRAN etc. Are procedural oriented language.                

Introduction To Computer System

Image
Introduction to Computer A computer is an electronic device capable of performing arithmetic and logical operations. It can also store a large volume of information . Characteristics of Computer SPEED The speed with which the computer works can be understood by the units of measurement of time within a computer. They are : MILLI SECOND – 1/1000 TH OF A SECOND MICRO SECOND – 1/1000 TH OF A MILLI SECOND NANO SECOND – 1/1000 TH OF A MICRO SECOND PICO SECOND – 1/1000 TH OF A NANO SECOND STORAGE As already discussed a computer can store a large volume of information. The factors to be considered for storage are : •           RETREIVAL – IMMEDIATE •           SPACE – VERY LITTLE •           MEDIA – MAGNETIC MEDIA •           LONGIVITY – FOR EVER ACCURACY The accuracy of the computers is consistently high. Errors in the machinery may occur, but due to efficient error-detecting techniques, these very seldom lead to wrong results. Errors in computing are due to human rather than techno

Differences between Break and Continue | C Programming

Differences between Break and Continue in C Programming The major difference between break and continue statements in C language is that a break causes the innermost enclosing loop or switch to be exited immediately. Whereas, the continue statement causes the next iteration of the enclosing for, while, or do loop to begin. The continue statement in while and do loops takes the control to the loop's test-condition immediately, whereas in the for loop it takes the control to the increment step of the loop. The continue statement applies only to loops, not to switch. A continue inside a switch inside a loop causes the next loop iteration. Practically, break is used in switch, when we want to exit after a particular case is executed; and in loops, when it becomes desirable to leave the loop as soon as a certain condition occurs (for instance, you detect an error condition, or you reach the end of your data prematurely). The continue statement is used when we want to skip one

Differences between Puts and Gets in C Programming | C programming

Differences between "puts" and "gets" in C Programming We can read a string using the %s conversion specification in the scanf function. However, it has a limitation that the strings entered cannot contain spaces and tabs. To overcome this problem, the C standard library provides the gets function. It allows us to read a line of characters (including spaces and tabs) until the newline character is entered, i. e., the  Enter  key is pressed. A call to this function takes the following form: gets(s); where s is an array of char, i. e., a character string. The function reads characters entered from the keyboard until a newline is entered and stores them in the argument string s, The newline character is read and converted to a null character (\O) before it is stored in s. The value returned by this function, which is a pointer to the argument string s, can be ignored. The C standard library provides another function named puts to print a string on the display. A

Differences between Structure and Union in C | C programming

STRUCTURE IN C A structure is a user-defined data type available in C that allows to combining data items of different kinds. Structures are used to represent a record. Defining a structure:  To define a structure, you must use the  struct  statement. The struct statement defines a new data type, with more than one member. The format of the struct statement is as follows:    struct [structure name]    {        member definition;        member definition;        ...        member definition;    }; UNION IN C A union is a special data type available in C that allows storing different data types in the same memory location. You can define a union with many members, but only one member can contain a value at any given time. Unions provide an efficient way of using the same memory location for multiple purposes. Defining a Union:  To define a union, you must use the  union  statement in the same way as you did while defining a structure. The union stateme

C Program to Store Information in Structure and Display it | C Programming

Structure    Arrays are used to store large set of data and manipulate them, but the disadvantage is that all the elements stored in an array are to be of the same data type. If we need to use a collection of different data type items, it is not possible using an array. When we require using a collection of different data items of different data types, we can use a structure.  Structure is a method of grouping data of different types.  A structure is a convenient method of handling a group of related data items of different data types.