manish27.p
BAN USER- 0of 0 votes
AnswersConvert ip address(32-bit) into string format.
- manish27.p in India| Report Duplicate | Flag | PURGE
Software Engineer / Developer C#
int *getarrangewords(int *arr1)
{
int i; //index of arr1
int j=2i; // if i is even
int j=2i-1; /// if odd
int arr2[size]; //o/p array
while(*arr1!=NULL)
{
if (arr1[i]<0)
{
j=2i-1;
arr2[j]=arr1[i];
i++;
}
else
{
j=2i;
arr2[j]=arr1[i];
i++;
}
}
}
wat about "madam";
i dnt think it would work here.
pl correct me..thanks in advance!!!!
char **issubset(int arr[],int key)
{
int sum=0;
int array[0][0];
for(i=0;i<sizeof(arr);i++)
{
for(j=0;j<sizeof(arr);j++)
{
if(arr[j]<=key)
{
array[i][j]=arr[j];
sum=array[i][j]+sum;
if(sum>=key)
{
break;
}
}
}
return (array);
}
//complexity is o(n^2)
is there any method apart from bitwise method.
- manish27.p July 30, 2013thanks
- manish27.p July 30, 2013let the text file name be text.dat.
void transp_matrix(FILE* fp,int rows,int col)
{
int j=0;
char **p;
p=malloc(rows*sizeof(char*));
for(int i=0;i<rows;i++)
{
p[i]=malloc(col*sizeof(char));
while(int ch=fgetc(fp) && ch!='\n')
{
p[i][j]=ch;
j++;
}
}
for(i=0;i<rows;i++)
for(j=0;j<col;j++)
{
p[j][i]=p[i][j];
}
}
let nth be the floor where egg breaks.
so m=n/(least no divisible by n except 1).
Hence m is the minimal no of tries.
int findindex(int arr[],int size,int key)
{
int i;
int num=size/4;
for(i=0;i<num;i++)
{
if(arr[i]==key)
printf("%d",i);
}
}
1)take the total sum of the array and divide it by two.
- manish27.p September 01, 20132)divide the array into two equal parts as said.
3) now each two parts should be as close as possible to the total sum/2.
4)consider the first part of array.
5)pick the first element from the array and subtract it from sum/2 say it comes as y..
6)now find the closest element to the y from the entire array.
7)go on doing the same till you reach the sum/2.