fork download
  1. #include<stdio.h>
  2. #include<conio.h>
  3. #include<ctype.h>
  4. void main()
  5. {
  6. char a[10];
  7. int flag, i=1;
  8. clrscr();
  9. printf("\n Enter an identifier:");
  10. gets(a);
  11. if(isalpha(a[0]))
  12. flag=1;
  13. else
  14. printf("\n Not a valid identifier");
  15. while(a[i]!='\0')
  16. {
  17. if(!isdigit(a[i])&&!isalpha(a[i]))
  18. {
  19. flag=0;
  20. break;
  21. }
  22. i++;
  23. }
  24. if(flag==1)
  25. printf("\n Valid identifier");
  26. getch();
  27. }
Success #stdin #stdout #stderr 0.02s 6964KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
ERROR: /home/aoueFx/prog:27:0: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit