Skip to main content

Posts

Showing posts from November, 2013

Array In C++ (Basic Level)

Just think, one day your teacher give you a box of different types chocolate, and tell you there are 10 types of chocolate you count only how much each type of chocolate , and put those numbers in your program and determine sum of them. What you will do? You able to count all chocolate number and store them in different variable. At least  10 variable need to store them. Do you know you can store them  into one variable? The method of this name is array. Array is the method of store one kinds of data into one variable. 5 7 5 2 9 8 11 4 3 10       0             1              2            3             4            5              6           7             8             9

Input & Output In C++ (Basic)

Cout<<”Print sentence”;     This statement is use to print out any kinds of sentence or string type values. Cout<<345;     This statement is use to print out any kinds of numeric numbers, without change. Cout<<variable;        This statement is use to print the value of variable. The value of the which variable we want to print, It is need to write that variable on variable place.

Switch, Case, Default Statements In C++

Switch case is uses as alternative of if….else. When we need to use long term of if…else then we use switch case for reducing program execution time. syntax: Switch(variable){ Case value 1: Statement; Break; Case value 2: Statement; Break;

do...while loop in C++

The do while loop is very similar to while loop . In the while loop first check final condition then execute the statement. But in the do while loop first execute the statement then check the final condition. Syntax: Initialization; Do{ increment/decrement;   } while(Final condition)

While Loop In C++

A while loop repeat to execute target statement as long as the given condition is true. Syntax:       Initialization ;       While(Final condition){      Increment/ decrements ;  } Initialization : Read the previous lecture . Final condition : Briefly explained in previous lecture . Increment/ decrements : Learn more read the previous lecture .

For Loop In C++

A loop can repeat the statement of a particular job continuously for a specific number of times. Loop Description Syntax For The condition can tested before statement execution.   For(Initialization, Final condition, increment /decrements ) { statement; } while First it check the condition then do the job. Initialization; While(Final condition) { Statement; increment /decrements; } Do..while First do job then test the condition. Initialization; Do{ Statement; increment /decrements; } While(Final condition)

If And Else Conditional Structure In C++

If If is a keyword, which is use as a conditional operator. If keyword execute the statement only if condition is fulfilled. if (condition) statement.

C++ Operator And Expression

Programming is nothing but one kinds of problem solver, which can solve different type of problem by using legal logic .for converting logic into program we use some operator. 1.         Arithmetic operators 2.         Relational operators 3.         Logical operators 4.         Increment and decrement operators 5.         Assignment operator   Arithmetic operators

Variables And Data Types In C++

Name Size* Range* Example Char 1 byte Signed: -128 to 127 unsigned: 0 to 255 ‘a’,’b’,’c’ Int 4 byte Signed: -2147483648 to 2147483647 unsigned: 0 to 4294967295 123,456,73,1. Bool 1byte True or false True,false Float 4bytes +/- 3.4e +/- 38 (~7 digits) 132.23,2.5,7 Double 8bytes +/- 1.7e +/- 308 (~15 digits) 1647464364,567 Char Char type of variable are use to assign or store a character which is enclose by 2 single quotes

Level 0

#Include<iostream> At first of the program I use here #include<iostream> for including a standard library file which name is