Try this out:
Code:
#include <stdio.h>
#include <conio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h> //you need this for the tolower function
int main () //start with int main NOT void main
//(don't really know why, just ask the experts here!)
{
int mark = 0;
char grade;
do
{
printf("what was your exam mark: ");
scanf("%d",&mark);
}
while( (mark < 0 ) || (mark >100)); //this is OK, don't know y FCF said otherwise
while(1) //infinite loop
{
printf("what was your grade : ");
grade=getchar();
if(tolower(c)=='a' )||(tolower(c)=='b')||(tolower(c)=='c'))
{
break;
}
}
clrscr();
gotoxy(14,14);
printf("your mark was %d and your grade was %c",mark , grade);
fflush(stdin);
getchar();
}