Skip to main content

Posts

Control Statements do while loop

Control Statements do while loop:              This statements is just like a while loop, only difference is that condition is checked after the execution of the statements. In the do.. while loop first the statements is executed in the do block, the the conditions are checked from the while block. Untill the condition turns false, the statements or block of statements from the do block executes. Syntax of do.. while loop: do { Single statement or Block of statements; } while(Condition); Control Statements for loop: for  loop is one of the powerful statements which is similiar to while loop. In the for loop contains 3 conditions,  Initial value, conditions and increment or decrement. until the conditions satisfies, the block of statements will be executed. for statements are often used to process lists such a range of numbers: Basic syntax of for loop is as follows: for( initial value; Condition; increment/dec...
Recent posts

Control Statements while loop

Syntax for Nested if Statements: if (expression) { Block of statements; } else if(expression) { else Block of statements; } { } Block of statements; Loops: Sometimes, we need to print a series of numbers or some block of contents for certain number of times, The major difference between branching and loop statement that the branching statements will execute the statements only one time, but the loop statement will execute mentioned number of times.  We start with  while  loops and then go on to show this can be converted to  do-while  and  for  loops. while loop The most basic loop in C is the while loop. A while statement is like a repeating if statement. Like an If statement, if the test condition is true: the statements get executed. The difference is once the statement have been executed, the condition in the while parenthesis is checked again. If it is still true the statements get executed agai...

Control Statements If Else

Control Statements:                  Control statements  are ways for a programmer to control the program, about what blocks of the program are to be executed at certain number of times. In other words,  A  control statement  is a statement that determines whether other statements will be executed.  The syntax of control statements are very similar to regular English words. Basically there are two types of control statements:  branching statements  and  loops . Branching : decides which part of the program executed,  Loops : decides, which block of program executes certain number of times. If Else: This is the most simple form of the branching statements. It is the branching control statement, decides which branch of the program executes. It takes an expression or condition in the parenthesis and executes the statement only when the condition satisfies. If the condition is not...

Introduction to C

C Language Introduction C is a general-purpose high level language. It is also called as procedural programming language. It was originally developed by Dennis Ritchie between 1969 and 1973. It was mainly developed as a system programming language to write operating system. Many languages like PHP, Java, Javascript have borrowed syntax/features directly or indirectly from C language. Compiler:          A compiler which is convert Human language into machine language.When you write any program in C language it need to compile that program using a C Compiler which converts your program into a language which is understandable by a computer. The format of  the machine language is Binary format. So before proceeding, make sure you have C Compiler available at your computer. It comes along with all flavors of Unix and Linux. You can also use online compilers incase you don't have one. Writing First Program: #inc...