MIPI_BaseC_WebinarFRTK/18_Seminar05/11_palindrom_p21.c

20 lines
400 B
C
Raw Normal View History

2024-11-13 09:22:28 +03:00
#include <stdio.h>
#include <inttypes.h>
int main()
{
uint32_t count=0;
for(uint32_t i=11;i<=999;i++) {
if ( i<100 && i%10 == i/10 ) {
count++;
printf("%" PRIu32 " ",i);
} else if(i>=100 && i%10 == i/100) {
count++;
printf("%" PRIu32 " ",i);
}
}
printf("Total polindroms %" PRIu32 "\n",count);
return 0;
}