Posts

Brief History of C++

Brief History of C++ During 1970 Dennis Ritchie created C Programming language .  In the early 1980′s, also at Bell Laboratories, another programming language was created which was based upon the C language . New language was developed by Bjarne Stroustrup and was called C++ . Stroustrup states that the purpose of C++ is to make writing good programs easier and more pleasant for the individual programmer. C++ programming language is extension to C Language. In C we have already used increment operator (++) . Therefor we called C++ as “ Incremented C ” means Extension to C . Versions of C++ Language There are several versions of C++ Programming Language - Visual C++ Borland C++ Turbo C++ Standardize C++ [ANSI C++] History of C++ The C++ programming language has a history going back to 1979, when Bjarne Stroustrup was doing work for his Ph.D. thesis. One of the languages Stroustrup had the opportunity t...

POP vs OOP and C vs C++

Image
Difference Between  Procedure Oriented Programming (POP) & Object Oriented Programming (OOP) Procedure Oriented Programming Object Oriented Programming Divided Into In POP, program is divided into small parts called  functions . In OOP, program is divided into parts called  objects . Importance In POP,Importance is not given to  data  but to functions as well as  sequence  of actions to be done. In OOP, Importance is given to the data rather than procedures or functions because it works as a  real world . Approach POP follows  Top Down approach . OOP follows  Bottom Up approach . Access Specifiers POP does not have any access specifier. OOP has access specifiers named Public, Private, Protected, etc. Data Moving In POP, Data can move freely from function to function in the system. In OOP, objects can move and communicate with each other through member functions. Expansion To add new data and function in POP is not so easy...

C Programs Example 2

Program to calculate the number of vowels in a given string #include<stdio.h> int main( )  {    char ch,c[50];     int k=0,a=0,e=0,i=0,o=0,u=0;        printf("\nEnter the string to find the number of vowels : \n");    scanf("%s",c);    ch=c[k];        while(ch!='\0')    { switch(ch) {   case 'a' : a++;  break;   case 'e' : e++;  break;   case 'i' : i++;  break;   case 'o' : o++;  break;   case 'u' : u++;  break;   default: printf(“\nNo vowels in string”);        }                      ch=c[++k];                     }    printf("\nNumber of vowel a is %d\n",a);    printf("\nNumber of vowel e...

C Programs Example 1

Prime Number PROGRAM prime.c #include<stdio.h> #include<conio.h> void main() {    int i,num;    clrscr(); //Clears the screen    printf("\n\t\tPRIME NUMBER CHECKING");    printf("\n\t\t---------------------\n");    printf("\nEnter the integer number to check for prime :");    scanf("%d",&num);    if(num==1)    {      printf("\n 1 is neither prime nor composite");   }    else   {               /* Initializing i=2(smallest factor other than one) and                  repeating for all values of i less than or equal to                  n/2      */    ...