Showing posts with label c++. Show all posts
Showing posts with label c++. Show all posts

Wednesday 9 February 2022

Procedural oriented programming / structured programming - The program blog

In this post, we will be going to discuss procedural-oriented programming, which is also called structured-oriented programming in detail. So let's get started to see what is procedural-oriented programming step by step.

-It is sometimes known as modular programming.

-Programs written are more efficient and easier to understand and modify.

-The procedural/structured programming languages are similar to solving a problem by humans. In a nutshell, humans attempt a problem by adopting a sequence of operations.

-It makes use of a top-down design model in which a program developer maps out the overall program structure into separate subsections.

-Large-size programs can be developed in structured programs such as pascal and c. Programs are divided into multiple sub-modules.

-Procedural/Structured programming languages such as FORTRAN, BASIC, ALGOL, COBOL, C, etc., are divided into a number of segments called subprograms. There is the main function and it invokes subprograms. Thus, it focuses on functions apart from data. here also the programmer can observe the lack of secrecy.

procedural oriented programming


-The control of the program can be transferred using an unsafe goto statement.

-This type of programming language uses different control structures that are as follows:
  • Decision/selection control statements
  • Iteration control statement
  • Jump control statement

-Data is global and all the sub-programs share the same data, i.e. data are globally accessible to all functions. Thus, any function operates on the global data and this directs to losing some vital information. We can conclude here that a module represents a function.

-Procedural structured/programming languages permit data transfer through messages by means of function.

-Least importance is given to the data in procedural/structured programming languages.

-Compiler and interpreter construction are easy and simple with this type of programming language. Furthermore, these compilers and interpreters need low memory to run on the computers.

-It is difficult to implement simultaneous processes/parallelization.

I hope you guys understand what is procedural-oriented programming. If you find any mistakes or have any doubts then please comment in the comment section. Thank you so much for reading the article.

Recommended post:

Tuesday 8 February 2022

Difference between C and C++ | C and C++ difference - The Program Blog

Hello readers in this post you guys will be going to see the difference between C and C++, and what are the similarity is there in C and C++. So guys let's see both differences and similarities available between C and C++.

difference between c and c++

Some differences between C and C++ is as follows:

-C is a procedure/function-oriented language and C++ language is driven by a procedure/object.

-Data is not protected in C, whereas data is secured in C++. The data hiding concept is absent in C.

-C uses a top-down approach while C++uses a bottom-up approach. The program is prepared step by step in c, and in C++ base, elements are prepared first.

-In C we cannot give the same name to two functions in a program, whereas due to the function overloading feature, the above concept is possible in C++. One can initialize a number of functions with the same name, but with different arguments. The polymorphism feature is built in C++, which supports this concept.

-C uses printf() and scanf() functions to write and read the data respectively, while C++ uses cout and cin objects for output and input operations, respectively. Further,the cout uses <<(insertion operator) and cin uses >> (extraction operator).

-C uses stdio.h file for input and output functions, whereas C++ uses iostream.h for these functions.

-Constructor and destructor are absent in C and the same are provided in C++.

-Inline functions are supported by C++, and the same is absent in C. Inline functions can be used as micros. They are stated by the word 'inline'.

I hope you guys get cleared what is the difference between C and C++. If you have any queries or any doubts regarding this then please do comment in the comment section below.


Recommended post: