MIPI_BaseC_WebinarFRTK/05_Lecture05/10_break_p32.c

16 lines
314 B
C
Raw Permalink Normal View History

2024-11-13 09:22:28 +03:00
#include <stdio.h>
int main() {
char c;
for(;;)//while(1)
{
printf( "\nPress any key, Q to quit: " );
// Convert to character value
scanf("%c", &c);
printf("%x\n",c);
if (c == 'Q')
break;
}
return 0;
} // Loop exits only when 'Q' is pressed