Software & Finance





Turbo C - Working With Arrays





Here is a simple program that is to initialize the array and count the number of elements in the perfect way.  

Also refer the following sample code that also explains the concept of array:

 

Find the biggest of N Numbers

 

Find the smallest of N Numbers

 


Source Code


#include <stdio.h>

#include <stdlib.h>

#include <conio.h>

#include <bios.h>

#include <ctype.h>

 

void main()

{

        int numbers[] = {  10, 11, 12, 13 };

        int numElements = sizeof(numbers) / sizeof(numbers[0]);

        for(int i = 0; i <numElements; i++)

                printf("%d\n", numbers[i]);

}

Output


10

11
12
13