#include<stdio.h> #include<stdbool.h> #include<conio.h> #include<math.h> #include<string.h> void main() { int result; char studentID[20]; printf("enter ID length must is 7 characters: "); A: gets(studentID); result = strlen(studentID); if(result == 7) { printf("true"); } else { printf("ID length must is 7 characters\n"); printf("re-enter : "); goto A; } getch(); }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter