void f(int a, int b)
{
printf("%d %d\n", a, b);
}
void main(void)
{
int i = 5;
f(++i, ++i);
}
int numbs[10]; int *ptr = numbs;which of the following are equivalent, and why?
for(x = i = 0; i <= 100; i += 2, x += i);
x = i = 0; while( i++ = 100) x += ++i;
for(x = i = 0; i <= 100; i++){
if (!(i % 2))
continue;
x = x + i;
}
int x(char *s, char *t)
{
for( ; *s == *t; s++, t++)
if (*s == '\0')
return(0);
return(*s - *t);
}
char *x(char *s, char c)
{
char *r = NULL;
do{
while(*s && *s != c) s++;
if (*s) r = s;
} while(*s++);
return(r);
}
void a_again(int acount)
{
++acount;
}
void main(void)
{
register int c;
int counter = 0;
while((c = getchar()) != EOF)
if (c == 'a' || c == 'A')
a_again(counter);
printf("%d\n", counter);
exit(0);
}
![]() |
ECS 153, Introduction to Computer Security Winter Quarter 2002 Email: cs153@cs.ucdavis.edu |