C Program to print WELCOME by using different syntax of initialization of array

#include”stdio.h”
#include”conio.h”
void main()
{
char arr1[9]={‘W’,’E’,’L’,’ ‘,’C’,’O’,’M’,’E’,’\0′);
char arr2[9]=”WELCOME”;
char arr3[9]={{‘W’},{‘E’},{‘L’},{‘ ‘},{‘C’},{‘O’},{‘M’},{‘E’}};
clrscr();
printf(“\n ARRAY1 = %s”,arr1);
printf(“\n ARRAY2 = %s”,arr2);
printf(“\n ARRAY3 = %s”,arr3);
getch();
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s