write about language C and C plus plus language
Answers
Answer:
What is C programming language?
C is middle-level programming language which was developed at Bell Lab in 1972 by Dennis Ritchie. C language combines the features of Low level as well as High-level Language. Hence its considered a middle-level Language.
C is a high-level classical type programming language that allows you to develop firmware and portable applications. The C language was developed with an objective of writing system software. It is an ideal language for developing firmware systems.
What is C++ programming language?
C++ is a computer programming language that contains the feature of C programming language as well as Simula67( a first object Oriented language). C++ introduced the concept of Class and Objects.
It encapsulates high and low-level language features. So, it is seen as an intermediate level language. Earlier it was called "C with classes" as it had all the properties of the C language.
Explanation:
Programming type-
C :It is a Procedural Oriented language.
C++ : It is an Object-Oriented Programming language.
Approach-
C language follows Top Down programming approach
C++ follow bottom-up programming approach.
File extension -
The file extension of a C program is .c
The file extension of a c+ + program language is.cpp
Program division-
In C programming language, a big program code is divided into small pieces which is called functions.
In C++ programming language, a big program code is divided into Objects and Classes.
Structure-
Structure in C not provide the feature of function declaration.
Structure in C++ provides the feature of declaring a function as a member function of the structure.
Inline function-
C does not allow inline function.
C++ supports inline function.
Standard I/O operations-
In C scanf and printf are used for the standard input and output
In C++ cin» and cout« are given for standard input and output operations.
Data Security-
In C language the data is not secured.
Data is secure in C++, so it can't be accessed by external functions. (Using Encapsulation concept of OOPs)
Ease of Coding-
C is an older programming language that is described as Hands-on. In this language, you must tell the program to do everything. Moreover, this language will let you do almost anything.
C++ is an extension language of C. It allows for the highly controlled object-oriented code.
Compatibility with other languages-
C is not compatible with another language.
C++ is compatible with the other generic programming languages.
Pointer-
C supports only Pointers.
C++ supports both pointers and references.
Variable-
In C, the variable should be defined at the beginning of the program.
C++ allows you to declare variables anywhere in the function.
Function Overloading-
C does not allow you to use function overloading.
C++ allows you to use function overloading.
Data Types-
C language does not allows you to declare String or Boolean data types. It supports built-in and primitive data types.
C++ supports String and Boolean data types.
Exception Handling-
C does not support Exception Handling. However, it can be performed using some workarounds.
C++ supports Exception handling. Moreover, this operation can be performed using try and catch block.
Functions-
C Does not allows functions with default arrangements
C++ Allow functions with default arrangements.
Namespace-
It is absent in C language.
It is present in the C++ language.
Global Variables-
C Allows Multiple Declaration of global variables.
In C++ Multiple Declaration of global variables are not allowed.
Inheritance-
Inheritance is not supported C
Inheritance is possible in C++ language.