Showing posts with label C Tutorials. Show all posts
Showing posts with label C Tutorials. Show all posts

Wednesday, 27 September 2017

Continue statement with Program | #28



Key Points :

# Continue Statement :-

                                * Continue Statement is used to run the loop in the program again.

                                * When the continue statement in the loop exicutes, it allow compiler to run the loop
                                  again.

                                * When continue statement exicutes, it skip the next statement/operation writen after
                                  it.


Break statement with Program | #27


Odd loop with program | #26



Key Points :

# Odd loop :-
                               
                                * Odd loop is a loop which take permission of user every time whenever it                                               exicutes.
                                * It ask user, whether he want to exicute loop again or not.
                                * If user give command to exicute again then this loop will run.

                                * If user dont want to run the loop again then it stops exicution.

Nesting of loops with program | #25



Key Points :

# Nesting Of Loops :-
                               
                                * Like 'if' statement, loops can be nested.
                                * Nesting is a process of putting one into another.
                                * Nesting of loops means we can put one loop into another or we can put multiple loops
                                  in the single loop.

                Example Syntax :-
                         
                                for(i=o;i<=j;i++)
                                {
                                satatement 1;
                                satatement 1;
                                .
                                .
                                satatement n;
                                                                for(a=o;a<=b;a++)
                                                {
                                                                satatement 1;
                                                                satatement 1;
                                                                .
                                                                .
                                                                satatement n;
                                                }
                                }



Tuesday, 26 September 2017

Do... while loop with program | #24



Key Points :

] Exit Control loop :
                               
                                * The loop in which the condition is checked at the last are known as
                                exit control loops.

                                * Because the condition is checked at last, maybe the condition become false,one time
                                this loom must be exicuted.

                The exit control loop is :

                                a] do...while loop


                a] do...while loop :
                                * As do...while loop is exit control loop, condition is checked at last.
                               
                                * Because of checking condition at the last, one false statement is exicuted in
                                do...while loop.
                               
                                * The semicolon is present after while condition.

                Syntax :
                               
                                do
                                {
                                                loop body;
                                                inc/dec;
                                }while(condition);

                # Note : do...while loop can executes one false condition.

                                Loop will exicute repeately until the condition in the while statement become false.

For loop with program | #23



Key Points :

 for loop :

                                * As for loop is entry control loop, first initilisation takes place & then the
                                condition is checked & at last the increment / decrement takes place.

                                * Initilisation,Condition,inc/dec written in the one line. So, LOC is decreased.
                                Because of this for loop is more used than other loops.
                               
                Syntax :
                               
                                for(initilisation ; Condition ; inc/dec)
                                {
                                                loop body;                                         
                                }

                # Note :
                                for loop executes only when the condition is true.
                                Loop will exicute repeately until the condition in the for statement become false.



While loop with Program | #22



Key Points :

1] Entry Control loop
                                The looping in which the condition is checked just after initilisation are known as
                                entry control loops.
                                The entry control loops are as follows :

                                a] while loop
                                b] for loop
                                1] Entry Control loop :
                               
                                The loop in which the condition is checked just after initilisation are known as
                                entry control loops.
                                The entry control loops are as follows :

                                a] while loop
                                b] for loop

                a] while loop :
                                As while loop is entry control loop, first initilisation takes place & then the
                                condition is checked & at last the increment / decrement takes place.

                Syntax :
                                initilisation;
                                while(Condition)
                                {
                                                loop body;
                                                inc/dec;
                                }

                # Note :
                                While loop executes only when the condition is true.
                                Loop will exicute repeately until the condition in the while statement become false.


Looping statements | #21



Key Points :

# Looping Statements :-

                                * If we want to perform any action repeatly, decresing LOC(Line Of Code), we use
                                looping Statements.

                                * Looping statement perform same action repeatly. We can limit looping statements so
                                that it perform such operation upto a definite time.

                                * In every looping statements there are 3 statements
                                                a) Initilisation
                                                b) Condition
                                                c) Increment/Decrement
                               
                                * In all looping statements initilisation takes place at first.

                Looping statements are mainly of 2 types

                                1] Entry Control loop
                                2] Exit Control loop

                1] Entry Control loop
                                The looping in which the condition is checked just after initilisation are known as
                                entry control loops.
                                The entry control loops are as follows :

                                a] while loop
                                b] for loop
                                1] Entry Control loop :
                               
                                The loop in which the condition is checked just after initilisation are known as
                                entry control loops.
                                The entry control loops are as follows :

                                a] while loop
                                b] for loop


Nested if else with program | #20



Key Points :

5] Nested if else :-
                                This is a decision making statement in which the multiple if else statements are written
                                between if else statements.

                Syntax :-

                                if(condition)
                                {
                               
                                    if(condition)
                                   {
                                    true block;
                                   }
                                    else
                                   {
                                    false block;
                                   }
                                 
                                }
                                else
                                {
                                false block;
                                }


Sunday, 24 September 2017

Nested if statement with Program | #19




Key Points :

* Nested if :-
                                The dicision making statement in which we can add multiple if statements in the single
                                if statement is known as Nested if statement.

                Syntax :-
                               
                                if(condition)
                                {
               
                                if(condition)
                                {
                                statement;
                                }

                                }

else if statement with program | #18



Key Points :

* else if Statement :
                                In this dicision making statement the condition is checked in if statement first &
                                if the statement in the if statement become false then each condition is checked after if one another. & the true condition /block is exicuted.

                Syntax :
                                if(condition)
                                {
                                  statement 1;
                                }
                                else if(condition)
                                {
                                  statement 2;
                                }
                                else if(condition)
                                {
                                  statement 3;
                                }
                                .
                                .
                                .
                                .

                # Note:

                                In this decision making statement, there can be many conditions.

if else Statement with program | #17

if (Decision Making) Statement in C with PROGRAM | #16



Key Points :

Decision Making Statements :
                                Decision making or Conditional statements are the statements in which the condition is checked & decision is taken.
                Ex. Decisions like in between a & b which is greater.
                    Value of a is equal or not equal to b. etc.

               
                Decision Making Statements are as follows:
                1] if
                2] if else
               

Wednesday, 20 September 2017

Logical Operators in C with PROGRAM #12



Key Points :

Logical Operators:-
                                The operators which are used in logical situations or which work only on True or False
(1 or 0) are known as logical operators.

                These are as follows:


                                 operators                                                                           Meaning

                                1] &&                                                                                    Logical AND
                                2] ||                                                                                      Logical OR
                                3] !                                                                                         Logical NOT

                # Truth table of AND
                                a                              b                             AND Result
                                0                              0                                  0
                                0                              1                                  0
                                1                              0                                  0
                                1                              1                                  1

                # Truth table of OR
                                a                              b                             OR Result
                                0                              0                                  0
                                0                              1                                  1
                                1                              0                                  1
                                1                              1                                  1

                # Truth table of NOT
                                a                              NOT Result
                                0                                  1
                                1                                  0


Relational Operators in C WITH Program | #11



Keypoints :

 Relational Operator :-
                                The operators which shows the relations ( less than, greater than etc ) between two
                                variables are known as Relational Operators.

                                Ex. a=2, b=3;
                                Then the relation between a & b will be a<b.


                The relational Operator & there meaning are as follows.

                                   Operator                                                                          Meaning

                                1] <                                                                             is less than
                                2] >                                                                             is greater than
                                3] <=                                                                           is less than or equal to
                                4] >=                                                                           is greater than or equal to
                                5] ==                                                                           is equal to
                                6] !=                                                                            is not equal to


Binary (Arithmetic) Operators in C with program | #10



Key Points :

Binary Operators :-
                                The operators which works on minimum 2 operands are known as Binary operators.

                #Types of binary operators :
                                1] Arithmetic operator
                                2] Relational operator
                                3] Logical operator
                                4] Assignment operator
                                5] Bitwise operator


                1] Arithmetic operator :
                                The operators which are used to perform all the arithmetical operations are known as
                                Arithmetic operator.

                 All the Arithmetic operators & there meanings are as follows.
               
                                  Operators                                                         Meaning

                                1]   +                                                                      Addition
                                2]   -                                                                       Substraction
                                3]   *                                                                      Multiplication
                                4]   /                                                                       Division

                                5]   %                                                                     Modulo Division


Popular Posts :