Pages

Monday, January 16, 2017

Difference between C and C++ Programming


Criteria
C Programming
C++ Programming
Language Type
C is Procedural and Function oriented programming language.
C++ is Object oriented and procedural programming language.
Level of Language
Low / Middle level
Middle / High level
Source file extension
.c
.cpp
Developed by
C originally developed by Dennis Ritchie between 1969 and 1973 at Bell Lab.
C++ was developed by Bjarne Stroustrup 
Supports
It has no support for encapsulation, polymorphism and inheritance
It supports for encapsulation, polymorphism and inheritance.
Security
Limited
Built in to language due to object oriented nature.
Basic Program
#include<stdio.h>
int main(){
   printf(“Hello”);
   return 0;
}
#include <iostream>
using namespace std;
int main(){
     cout << "Hello";
     return 0;
}

Printing output using variable
printf(“Maths=%d”, marks);
cout << “Maths=” << marks;


* * * * *


* * * * *

No comments:

Post a Comment