Looping in C Programming Language

 Looping in C Programming Language Use: When we want to perform specific task repeatedly then we can use looping. In C Language there are three type of loop: For Loop While Loop Do while Loop Nested for Loop Each Loop statement requires three things: Initialization  Test Condition Increment/Decrement Operation 1. For Loop: For Loop is a repetition control structure which allow us to write a loop that is executed a specific number of time. Syntax:               for( initialization ; test condition; increment/decrement operation)                 {                    ------                    body of for loop;                    ------               } 2. While Loop: While Loop is use to per to p...

Definition of variable in C Language

 DEFINITION OF VARIABLE IN C LANGUAGE


  • Variable is a name of data which is used to store and hold value.
  • Example:
    • int a,b,c;
    • Here, int - integer is a keyword and data type and a,b,c are variable name.
  • Variable name should be meaningful and short.
    • Example:
      • int avg;

  • Rules of Variables:
    • It can be lower case and upper case.
    • It includes alphabets, numbers, underscore.
    • It doesn't start with number or digit.
    • It doesn't contain white-space.
    • It can't use a keyword.
    • We can give 31 letter.
    • Example:
      • int TOTAL;---right
      • float _sum;---right
      • int stu rollno;---wrong
      • int 1no;---wrong
      • int auto;---wrong 




Comments

Popular posts from this blog

Data Types in C Program

Different Modules to solve the program/problem

Operators in C Program