If, Else If, Else
In micocontroller c programming and computer c programming, if statement can be used to test whether a condition is true or false. When a condition is true the statement after it will be executed, otherwise other statement will be executed. Example program :
#include <stdio.h>
int main()
{ int b;
printf("Enter a value:");
scanf("%d", &b);
if (b < 0)
{printf("The value is negative\n");
getchar();
getchar();
}
else if (b == 0)
{printf("The value is zero\n");
getchar();
getchar();
}
else
{printf("The value is positive\n");
getchar();
getchar();
} return 0; }
Microcontroller
What is a Microcontroller?
Microcontroller Specification
Programming PIC16F877A
Playing with a C Programming and PIC16F877A
Creating a Digital Clock using PIC16F877A, LCD and DS1337 Clock IC from Dallas
How to Load Hex File into PIC16F877A
Articles :
Lightning Surge Testing
Bit Error Rate Testing
Insertion Loss Testing
Light Emitting Diode
DC Power Jack
Voltage Regulator and Diode
Transistor and Operational Amplifier
Trimmer Pot, Relay and PCB
Understanding PIC16F877A
Product Development Using PIC16F877A
More Product Development Using PIC16F877A
PIC16F877A Input Output Overview
Interfacing PIC16F877A With LCD
VoIP Basic
VoIP Phone
Using VoIP Through Normal PSTN Telephone
What is Codec?
C Programming Tutorial
Introduction
What is C programming language?
The First C Program
The First C Program - Explanation
Variables
Printf
Reading User Values
Scanf
Looping
Using FOR loop
Arrays
More on Arrays
Example Program that use Arrays to Compare 6 PIN number
If, Else If, Else
Functions
Pointers
Summary