C language output hexadecimal multiplication table

C language output hexadecimal multiplication table

1. Run the code and the results are as follows.

Insert picture description here

2. Source code

#include<stdio.h>
void main ()
{
	int i,j,k=0;
	for(i=1;i<16;i++)
		for(j=1;j<16;j++)
		{
			printf("%-4.0X ",i*j);
		        k++;
		        if(k%15==0)
			printf("\n");
		}
}

Guess you like

Origin blog.csdn.net/peter_young1990/article/details/114805536