using codeblock
-----------------------------------------------------------------------------------
// initialization of strings
#include <stdio.h> // header file
int main() // main function
{
char strings[5][5]={"RAM","sita","Hary","Niraj"};// initialization of 4 strings with 2 dimensional array
int i; // variable declaration
for(i=0;i<=3;i++) // loop which executes 4 times because we have taken 4 strings so.
{
printf("%s\n",strings[i]); //display of strings
}
return 0; // return statement
}
-----------------------------------------------------------------------------------
// initialization of strings
#include <stdio.h> // header file
int main() // main function
{
char strings[5][5]={"RAM","sita","Hary","Niraj"};// initialization of 4 strings with 2 dimensional array
int i; // variable declaration
for(i=0;i<=3;i++) // loop which executes 4 times because we have taken 4 strings so.
{
printf("%s\n",strings[i]); //display of strings
}
return 0; // return statement
}
-----------------------------------------------
using turboc++
-------------------------------------
// initialization of strings
#include <stdio.h> // header file
#include<conio.h>
void main() // main function
{
char strings[5][5]={"RAM","sita","Hary","Niraj"};
// initialization of 4 strings with 2 dimensional array
int i; // variable declaration
for(i=0;i<=3;i++) // loop which executes 4 times because we have taken 4 strings so.
{
printf("%s\n",strings[i]); //display of strings
}
getch(); // to hold the output.
}