DeepakRulez
BAN USER
Comments (4)
Reputation -5
Page:
1
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
0
of 0 vote
Answer for this problem is 9
- DeepakRulez October 17, 2012Comment hidden because of low score. Click to expand.
-1
of 1 vote
void main()
{
int a[7][5]={
-1,-1,-1, 0, 0,
-1,-1, 0,-1,-1,
0, 0, 0, 0,-1,
0, 0, 0,-1,-1,
0, 0, 0,-1, 0,
0,-1, 0, 0, 0,
0,-1, 0, 0, 0,
} ;
int i,j,count=0;
clrscr();
for(i=0;i<6;i++)
{
for(j=0;j<4;j++)
{
if(a[i][j] == -1 && a[i][j+1] == -1)
count++;
if(a[i][j] == -1 && a[i+1][j] == -1)
count++;
}
}
printf("%d",count);
getch();
}
Comment hidden because of low score. Click to expand.
0
of 0 vote
My bad.... it should be '>' instead of '>='.
- DeepakRulez October 16, 2012Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
Yes.. Jenish.. It should be 3... I interpreted the problem wrong....
Here is the code...
- DeepakRulez October 17, 2012