There is a program to compute word length of a machine as below.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <stdio.h>

int wordlength(void);

int main()
{
printf("Word Length: %dn", wordlength());
return 0;
}

int wordlength(void)
{
int i;
unsigned v = (unsigned)~0;

for (i = 1; (v = v >> 1) > 0; ++i)
;
return i;
}

Reference

The C Programming Language