[MS]excel labels
Excel labels its rows with letters. For example row 0 is labeled 'A', row 1 is labeled 'B', row 26 is labeled 'AA', and so on.
Design, and implement in C, an algorithm that will map any row number, such as 2842, into into its proper row designation. For instance row 2842, maps to the designation 'DEI'
Design, and implement in C, an algorithm that will map any row number, such as 2842, into into its proper row designation. For instance row 2842, maps to the designation 'DEI'
void rowmap(const int row)
ReplyDelete{
if(row < 26)
{
printf("%c", 'A' + row);
}
else
{
div_t x = div(row, 26);
rowmap(x.quot - 1);
rowmap(x.rem);
}
}