C Programming Tutorial

 

Looping

Let's say that we would like the processor to do something until certain condition are met. For example to print value in variable a until value in variable a is 100.This is easily accomplished with a for loop or a while loop:

#include <stdio.h>

int main()
{
    int a;
    a = 0;
    while (a <= 100)
    {
        printf("Value in variable a now is : %d \n", a);
        a = a + 10;
    }
    getchar();
    return 0;
}


If you run this program, it will produce a table of values of variable a. The output will look like this:

Value in variable a now is : 0
Value in variable a now is : 10
Value in variable a now is : 20
Value in variable a now is : 30
Value in variable a now is : 40
Value in variable a now is : 50
Value in variable a now is : 60
Value in variable a now is : 70
Value in variable a now is : 80
Value in variable a now is : 90
Value in variable a now is : 100

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

 

 

 

 

 

 

 

 

 

 

 

Copyright www.electronics.netmyne.com.