C program to initialize array elements without mentioning array size and then display on screen.

 C program to initialize array elements without mentioning array size and then display on screen



/*******************************************************

C program to initialize array elements without mentioning array size and then display on screen. 

*******************************************************/

#include<stdio.h>

#include<conio.h>

void main()

{

    int i;

    //array initialization

    int number[]={20,40,60,48,30};

    clrscr();

    //display array elements on screen

    printf("The array elements are\n");

    for(i=0;i<5;i++)

    {

        //display of array elements

        printf("%d\t",number[i]);

        

    }

    printf("\nEnd of program");

}

The array elements are

20 40 60 48 30

End of program


टिप्पणी पोस्ट करा

0 टिप्पण्या