Posts

Showing posts with the label C Programming

Control Statements | IF Statements | Switch Statement | Examples

Image
Control Statements  These are those statement which controls the flow of program control. They transfer the control of program to another part of program conditionally or unconditionally. There are several control statements in the C Programming which are being discussed below - If Statement  If statement evaluates the condition inside the parentheses. if the condition is true then statement inside the if body are executed and if the condition is evaluated to false then statements inside the body of if are skipped. Syntax :  if(condition)                 {                     Statements;                  } Flow Chart :  If-If Statement  This is used to check multiple conditions for a particular problem. Syntax :       if(condition)       {     ...

Concept of Storage Classes In C

Image
What are Storage Classes ? Storage classes in c programming are used to describe about the features of a variable/functions.  These features basically include scope , life time , default value, storage area of variable/functions in c. Scope : It means the area of code where a variable is accessible. Life Time : It means the time duration during runtime till which our variable is live or can be used. In this time duration doesn't means the actual time it related with function life where it is used for that duration. Default Value : It is the value which is assigned to variable initially when we declare it. Storage Area : It means where our variable data is stored whether it is in register or hard disk,etc. Types of Storage Classes Auto  * Any variable in c programming is auto variable by default. So, there is no need to use the keyword auto.   * if variable is not initialized , by default auto variable contains garbage value. * auto variable is...