#include <stdio.h>
#include <stdlib.h>
main()
{
int answ,points;
printf("enter char");
scanf("%d",&answ);
switch(answ)
{
case 'a' : points =4;
break;
case 'b' : points =3;
break;
case 'c' : points =2;
break;
case 'd' : points =1;
break;
case 'f' :
case 'i' :
case 'w' : points =0;
break;
}
if((answ >='a')&&(answ<='d'))
printf("passed, points earned = %d",points);
else
printf("failed, no points earned");
system("pause");
}
No comments:
Post a Comment