Posts

Showing posts from June, 2022

Difference between Compile Time and Run Time

  Compile Time :  It is a Time window During which a Program is Compiled. During Compilation , a source code or program is converted into machine code. There are two types of errors in Compile Time known as Compile Time errors : Syntax Error Semantic Error Syntax Error :  The Error occurs due to mistake in syntax or predefined way of writting a programm during compilation is called Syntax Error. Example :  #include<iostream> using namespace std; int main() {     int a = 10:        // Every statement should be ended with an ' ; ' (semicolon) , but here it is ended with                              // ' : ' (colon) it is an syntax error .     int b = 20;     return 0; } Semantic Error :  The wrong and meaningless code/statement in a programm are called Semantic Errors. Example :  int main() {...

OOP vs POP

Image
  OOP(Object Oriented Programming) OOP is a type of language which works on concept of Objects. Object is the instance of classes which is created to initialize Classes, when classes are initialize the memory is allocated to them. In OOP a program is sub-divided into objects Example Of OOP languages : C++, C#, Python, Java, VB.net etc. POP(Procedural Oriented Programming) POP is a type of programming language which works on the concept of functions. In POP a program is sub-divided into functions. Example of POP languages : C, COBOL, BASIC, FORTRAN etc. Difference between OOP and POP : source : www.journeywithranjan.blogspot.com

C++ Programming Language Easy Course

Image
C++ C++ is a low level general purpose programming language, It was developed by Danish scientist Bjarne stroustrup as an extension of the C programming language. Bjarne Stroustrup in his Lab source : https://img.gfx.no/2582/2582098/Bjarne%20Stroustrup.1000x563.jpg It has all the features of C language but Unlike C it is Not un Procedural Oriented Language it is an Object Oriented Programming Language that's why It is often called 'C with classes'. Object Oriented Programming language(OOP) Object Oriented Programming Languages are those Programming languages which uses the concept of 'Ojects'. These Objects contain Data in the form of  Attributes and Codes in the form of Methods or Behaviour. For example : A person Has basic propertiese like Name, age and height these are called attributes and the behaviour of person includes walking, talking and doing any work. Class A Class is an user defined data type which contains data members and member functions. It is de...

A program to Add numbers divisible by 3 or 5 in C++

Problem - To find the sum of numbers divisible by 3 or 5. Input- 20 Output- Numbers divisible by 3 or 5 are given below 3 5 6 9 10 12 15 18 20 The sum of numbers divisible by 3 or 5 is - 98 Program - #include<iostream> using namespace std; int main() {     int num;     cout<<"Enter the number ";     cin>>num;     int sum=0;     cout<<"\nThe numbers divisible by 3 or 5 are given below "<<endl;     for(int x=0;x<num;x++)     {         if(x%3==0)         {             cout<<x<<endl;             sum=sum+x;         }         else if(x%5==0)         {             cout<<x<<endl;             sum=sum+x;         }     } ...