Posts

Showing posts from August, 2016

Standard Library Functions

Image
According to wikipedia ... Standard stands for a level of quality or attainment.       Library stand for collection of book. Function is an activity that is for a purpose of a person or thing. Therefore The Standard Library Functions  are defined as  ... "Standard Library are the collection of subprograms (function) which is used to develop other programs or software." ♥ Types of Functions 1- Library Functions  (Header Files function)                         //In this post 2- User Defined Function (User Defined Functions)               // In next post ♣ Character Functions Character Functions, are the collection of all the function related with characters. The header file is "ctype.h" is used to use following functions. # isalnum() - is - " Is " is used to form question. al-   al stands " alphabet " . num...

If and If-Else Program

Image
If statement :- The if statement evaluates the test expression inside parentheses. If test expression is evaluated to true ( nonzero ), statements inside the body of if is executed. If test expression is evaluated to false ( 0 ), statement inside the body of if is skipped. Flow Chart of if statement :- Basic if syntax :- if ( statement is TRUE ) { /* between the braces is the body of the if statement */ Execute all statements inside the body } Example :- Ques - Program to Print number is even. #include <iostream> //Header file using namespace std; int main () //Main function { int number ; cout<<"Enter a number :"; // Print on the screen cin>>number; // Take input from the console / user. // Test expression is true if number is perfectly divide by 2 if ( number % 2 == 0 ) // % means find remainder , == means perfectly equal { cout<< "Even number" ; ...

Pseudo Code, Algorithm, Flow Chart and Programing

Image
In computer Science , Any Programing Question will be answered by four ways... 1- Pseudo Code 2- Algorithm 3- Flow Chart 4- Programming (Coding) Let's see all These with example. Ques - Write a Program to take two numbers from users and return its sum along with its Pseudo code, Algorithm and Flowchart.  ♥ Pseudo Code Pseudo Code is also called Program Design Language. It is high level language. It is used to wright steps of a program in English. It is very simple to understand and easy to wright. Answer- Step 1- Include Header Files Step 2- Declare three variables Step 3- Get the input from user Step 4- Perform operation (Sum operation) Step 5-  Display Sum Step 6- Terminate program ♥ Algorithm Algorithm is an Step by Step instruction to performs operation. It is well defined Language used to describe Programs. It is written in English language with programing Syntax. It is very efficient and very useful. It can be ...

Syntax in C++

Image
Syntax is defined as a way of writing a program. It just like when we write English Sentences we think about grammar that our sentence should be grammatically right...same thing with the program's Syntax is like a grammar in our programs. " The Valid Structure of Statement in a program is called Syntax. " # if Syntax if (condition) { block statement1; } # if else Syntax if (condition) { block statement_1; } else { block statement_2; } # if else ladder Syntax if (condition) {block statement1;} else if (condition1) {block statement2;} else if (condition2) {block statement3;} else {default statement4;} # switch syntax switch (choice) { case 1: statement 1; break/continues ; case 2: statement 2; break/continues; case 3: statement 3; break/continues; . . . case n: statement n; Default : default statement; } # while loop Syntax while (condition) { statement1; statement2; . . statement n; ...

Flow of Control

Image
Control Structures defines as   " The statement which controls flow of execution of the program are the control structures. " 0r " It controls the flow of execution. " There are three types of Control Statement   1- Sequence / Linear - In this type of execution,there is no control statements. All statement in a the program are executed on after one or one by one. 2- Alternative / Branching / Selection / Jumping - In this type of execution,Some parts of the program will be execute depending upon the conditions. Eg- - if statement , - if-else statement , - if ladder - switch 3- Iterative / Looping - There are the statement which execute some statement repeatedly. The statement which are execute repeatedly is known as body of the loop. Eg- - for loop -while loop -do while loop Now , There are two types of loop... a) Entry Controlled loop -  Before entry to the loop condition is checked if it is true controls enter ...

Operators and Expressions

Image
Definition " Operators are the symbols which performs some operation on operands. " "  Expreation is any valid combination of operators, constants and variables. " Types of operators There are two types of operators      a) On the basis of type of operands                1- Unary operator               2- Binary operator               3- Ternary operator       b) On the basis of type operation performed                1- Arithmetic operator               2- Logical operator               3- Relational operator               4- Bit wise operator               5- Assignment operator...

DATA HANDLING

Image
Data - Data is like a raw facts and statistics collected together for reference or analysis and useful information is derived from data only. " Data Types are means to be identify the types of data and associate operations of handling it. " There are two types of data: 1) Fundamental Data Type 2) Derived Data Type Fundamental Data type - -   These   are not composed of other data types. - It is also called Primary Data type like- 1- Integer - the number without fractional part or decimal part is called Integer. 2- Characters - any single character enclosed in single quote. 3- Float - the number with frictional part or decimal part is called float. 4- Double 5- Void - It specifies return types of a function or non-returning function. Data Type Modifiers -        These are the keywords which are  used to modify the storing capacity of the variables. like- 1- singed 2- unsigned 3- short 4- long Note- ...

ERRORS and It's Types

Image
Error are the most important term in programing... Every beginner as well as professional programmer should face the problem of errors. There error can be defined as   " Error is not getting a genuine result due to mistaken instruction. " Or  " These are the simple mistakes which leads to not getting correct results or may be program will not execute " In Book or in Internet you can find out many types of errors but all errors are similar to or slightly different from each other... but there are only THREE TYPES OF BASIC ERRORS  i.e, 1- Syntax Error / Compile Time Error  2- Run Time Error  3- Logical Error / Semantic Error Syntax Error - - These are the errors, when grammatical rule of C++ (any language) is not followed. - There errors are shown at the time of compilation. - It is also called Compile time error. Eg- Syntax of for loop         for ( ;  ; )       ...

Getting Starting With C++

Image
OVERVIEW  ABOUT C++ ○ C++ is a programming language ○ C++ is a middle-level programming language ○ Developed by Bjarne Stroustrup starting in 1979 at Bell Labs ○ C and C++ became a widely used programming language ○ C++ fully supports object-oriented programming (OOP's) . ○ OOP's is a model of programming language or It is a Concept. FEATURE OF C++ ○ C++ is Easy to learn and Understand. ○ C++ is usually considered a "multi-paradigm" language. ○ It produces more efficient programs. ○ It can also handle low-level activities as well as high level activities ○ It can be compiled on a variety of computer platforms. ○ C++ is an object oriented programming language therefore it supports: 1. Polymorphism (one name and many forms) 2. Encapsulation (wrapping of a data & function in single unit) 3. Data Abstraction ( hiding of data and showing important features) 4. Inheritance (deriving data from one class to another) 5. Data Banding (com...