Hey everybody. I was just making an algebraic equation calculator that has a little bug in it and I don't see whats wrong with it. The glitch is... When it gets into a while loop it will skip the users input once then it will complete the loop and the next time ask for it. Here is the code... Please help this has me stumped.
Thanks.Code:#include <stdio.h> main() { int var; int letnum = 0; int varcheck = 0; int varletter[100]; int vardisplay = 1; printf("enter the number of variables (max 100):"); scanf("%d",&var); while (var >= varcheck) { printf("\nplease enter the letter for variable %d:",vardisplay); scanf("%c",&varletter[letnum]); vardisplay++; letnum++; varcheck++; } }