B
birensubudhi
1) void foo(char *s,char *t)
{
while(*s++=*t++);
}
which C function is equivalent to foo ?
2) #define ROUND(x,n)
((x+n-1)&(~(n-1)))
what is hte value of ROUND(223,64) ?
DESCRIBE IT HOW IT IS SO?
3) void foo(int x)
{
int i=0;
while(x)
{
x=x&(x-1);
i++;
}
printf("%d",i);
}
what is the o/p of this function & why it is so ?
what function does this '&' does ?
4) union{
int i;
char c[sizeof(int)];
}x;
x.i=1;
if(x.c[0]==1)
printf("the m/c is _______________ endian");
else
printf("the m/c is _______________ endian");
fill in the blanks with tthe correct option:
a) little,big b)big,big
c) big,little d)little,little
5) int fun2(char *a,char *b)
{
for(; *a==*b;a++,b++)
if(*a=='\0')
return 0;
return *a-*b;
}
char a[10]="date",b[10]="data";
what is the value of fun2(a,b)?
{
while(*s++=*t++);
}
which C function is equivalent to foo ?
2) #define ROUND(x,n)
((x+n-1)&(~(n-1)))
what is hte value of ROUND(223,64) ?
DESCRIBE IT HOW IT IS SO?
3) void foo(int x)
{
int i=0;
while(x)
{
x=x&(x-1);
i++;
}
printf("%d",i);
}
what is the o/p of this function & why it is so ?
what function does this '&' does ?
4) union{
int i;
char c[sizeof(int)];
}x;
x.i=1;
if(x.c[0]==1)
printf("the m/c is _______________ endian");
else
printf("the m/c is _______________ endian");
fill in the blanks with tthe correct option:
a) little,big b)big,big
c) big,little d)little,little
5) int fun2(char *a,char *b)
{
for(; *a==*b;a++,b++)
if(*a=='\0')
return 0;
return *a-*b;
}
char a[10]="date",b[10]="data";
what is the value of fun2(a,b)?