Advertisement
imthaking

Untitled

Dec 12th, 2014
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. void IDName(int a)
  2. {
  3. int Flag = 0, counter = 0, i, max = 0;
  4. char ID;
  5. while (Flag == 0)
  6. {
  7. fflush(stdin);
  8. if (a == ID_1)
  9. {
  10. max = 9;
  11. printf("Please Insert your ID(your ID must be consisting of 9 numbers between 0-9\n");
  12. }
  13. else if (a == INDEX_1)
  14. {
  15. max = 4;
  16. printf("Please Insert your Last 4 Credit Card digits(The Number must be consisting of 4 numbers between 0-9\n");
  17. }
  18. ID = getchar();
  19. fflush(stdin);
  20. for (i = 0; i < max; i++)
  21. {
  22.  
  23. if (ID >= '0' && ID <= '9')
  24. {
  25. ID = getchar();
  26. fflush(stdin);
  27. }
  28.  
  29. else counter++;
  30. }
  31. if (counter == 0) Flag = 1;
  32. else counter = 0;
  33.  
  34.  
  35. }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement