ARRAYS

Arrays are widely used data type in ‘C’ language. It is a collection of elements of similar data type. These similar elements could be of all integers, all floats or all characters. An array of character is called as string whereas and array of integer or float is simply called as an array. So array may be defined as a group of elements that share a common name and that are defined by position or index. The elements of an arrays are store in sequential order in memory.


WAP to input your name and display it

#include

void main ( )

{

char nm [15];

clrscr ( );

printf (“enter your name”);

gets (nm);

printf (“name is %s”,name);

getch ( );

}