Posts

Showing posts from October, 2019

C Programming looping statements (part 2)

Next looping statements will continue here 2.while:  While is one of the important looping statement  In while, we assign at somewhere ,condition we place in while and increment or decrement at last. While and for is same but the difference is syntax functionality is same. By using while code length is increasing. Syntax:       Assignment; While (condition)   //Simple statements; Increment or decrement operation; While loop is simple like for loop but writing code is somewhat difficulty in means of writing three statements in a code. Example----  i=0; while(i<5) printf ("SSCprogramming"); i++; In the above code assignment is happened initially. After that while checks the condition then it moves on next statements inside the while loop  Then increment happen. Output is 5 times prints SSCprogramming 3. Do-while   This is reverse of while in case of checking condition.  In this intialisation or assignment will be at some place befo...

C Programming loops

Welcome to c programming learning Looping statement are most popular for writing any because if we want to make iteration in a program must we need looping statements that's why looping statements are playing key role in the coding.  Now let's move on to looping statements Looping statements are  1. For loop 2.while loop 3.do-while loop These three we use for iterations in coding.... 1. For loop   For loop consist of three simple statements in the for loop two brackets. Syntax: for(assignment statement; conditional or control statement; increment or decrement statement)   In the above is syntax for the looping statement of for.  In this one statement that is increment is not there then also it execute. If we using conditional statement must be assignment is done. If the three statements are not present in the for loop the loop will iterate infinite times. But there must be place the semicolon (;) three times. If w...

C programming statements

Commonly statement is a line of code in c programming but statement also some types 1.simple statement:      Simple statements don't have any condition and also they ends with semicolon (;). Like printf and scanf statements Example--   1. printf("c programming learning");   2. scanf("%d",&a);   The above two can we called as simple statements.  2. Conditional or control statement:   These are having condition in the line. It may contain some block of code, if the condition is true then only inside block will execute otherwise won't execute.   That's why for these statement we don't put semicolon at the end of the statement  Examples-----  1.if(a<2)    {       Printf ("SSCprogramming");   }    If and only if the a value must be less than 2 then only this will execute otherwise not execute.  That's why we have to care about condition, what we are using in the code. This will execute ...