1.Implement a functionthat prints the numbers from 1 to 100.But for multiples of three (3) print "Zif" insteadof the number And for the multiples of five (5) print "Nab". For numbers whichare multiples of both three and five print "Zifnab".
void Printzifnab (int from, int. to) {if (from > To) return;for (int i = from; I <= to; i++) {if ((i% 3 = = 0) && ; (i% 5 = = 0)) {printf ("zifnab\n");} else if ((i% 3 = = 0)) {printf ("zif\n");} else if ((i% 5 = = 0)) {printf ("nab\n");} else {printf ("%d\n", I);}}}
2. Unsigned short convertrgb888torbg565 (unsigned int nsourcecolor)
Parameters: nsourcecolor–32 Bits RGB color to convert.
Return: The converted color as a and Bits RGB color.
This function, converts an RGB, BITS color format to RGB, BITS color format. The BITS formats contains 8 bits of empty padding.8 bits for Red.8 bits for GREEN and 8 bits for BLUE. In that order. Now there is a to-down convert this value to the bits. By has 5 bits for RED, 6 bits for GREEN and finally 5 bits for the BLUE.
Color Help:
Red = 0x00ff0000
Green = 0x0000FF00;
Blue = 0x000000ff;
White = 0X00FFFFFF;
Black = 0x00000000;
The second problem is solved.
C + + Pen Test Two, solve the problem