C Programming Unit3
C Programming Unit3
An array is a variable that can store multiple values. An array is defined as the collection of
similar type of data items stored at contiguous memory locations. By using the array, we can
access the elements easily. Only a few lines of code are required to access the elements of
the array.
For example
int mark[5];
char str[30];
#include <stdio.h>
int main()
{
int n[10],i;
int arr[3][4];
int arr[3][4]={{1,2,3,4},{2,3,4,5},{3,4,5,6}};
#include <stdio.h>
int main()
{
int num[3][3],i,j;
String : The string can be defined as the one-dimension array of characters terminated
by a null character ('\0'). The termination character ('\0') is important in a string since it is
char str[10];
char str[]={'j','a','i','p','u','r','\0'};
char str[]=”jaipur”;
char str[10]=”jaipur”;