### Zoho Interview | Set 1 Question 3

Save the string “WELCOMETOZOHOCORPORATION” in a two dimensional array and search for substring like “too” in the two dimensional string both from left to right and from top to bottom.

```w e L C O
M E T O Z
O H O C O
R P O R A
T I O n ```
` `
` `
And print the start and ending index as
Start index : <1,2>
End index: <3, 2>

My Solution ::

```#include <stdio.h>
main()
{
char *c="welcometozohocorporation";
char array[5][5];
int x;
int y;
int i=0;
for(x=0;x<5;x++)
{
for(y=0;y<5;y++)
{ array[x][y]=c[i]; //intialising the characters of string to the 2d array
i++;
}}
for(x=0;x<5;x++)
{
for(y=0;y<5;y++)
{
printf("array[%d][%d]=%c\n",x,y,array[x][y]);//printing the 2d array to make sure that it has been initialised with the string characters
}
}
for(x=0;x<5;x++)
{
for(y=0;y<5;y++)
{
//check for left to right existence
if((array[x][y]=='t')&&(array[x][y+1]=='o')&&(array[x][y+2]=='o'))
{
printf("it starts at %d,%d",x,y);
printf("\n");
printf("it ends at %d,%d",x,y+2);
}
printf("\n");
//check for top to bottom existence
if((array[x][y]=='t')&&(array[x+1][y]=='o')&&(array[x+2][y]=='o'))
{
printf("it starts at %d,%d",x,y);
printf("\n");
printf("it ends at %d,%d",x+2,y);
}
}}

}```

1. This comment has been removed by the author.

### C Questions

C Questions
C Questions

Note : All the programs are tested under Turbo C/C++ compilers.
It is assumed that,
Programs run under DOS environment, The underlying machine is an x86 system, Program is compiled using Turbo C/C++ compiler.
The program output may depend on the information based on this assumptions (for example sizeof(int) == 2 may be assumed).
Predict the output or error(s) for the following:

void main()
{
int const * p=5; printf("%d",++(*p));
}
Compiler error: Cannot modify a constant value.
Explanation:
p is a pointer to a "constant integer". But we tried to change the value of the "constant integer".
main()
{
char s[ ]="man"; int i;
for(i=0;s[ i ];i++)
printf("\n%c%c%c%c",s[ i ],*(s+i),*(i+s),i[s]);
}
aaaa nnnn
Explanation

### Zoho Interview | Set 1 (Advanced Programming Round)

Third Round: (Advanced Programming Round) Here they asked us to create a “Railway reservation system” and gave us 4 modules. The modules were:
1. Booking
2. Availability checking
3. Cancellation
4. Prepare chart
We were asked to create the modules for representing each data first and to continue with the implementation phase.

My Solution :