guys please check this code and tell me why the hell this is not working?
Question is-a test consisting of 10 multiple choice ques is administered to a batch of two students.first we input correct options on terminal like(abcdeabcde) and then students answers respectively.
and will got result for each ques.
but this code is not working....
/*............................STARTING OF CODE...................*/
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
#define QUES 10
#define STUD 2
/* COADED BY NIKHIL SAGAR */
void main()
{
int i;
char answer[QUES],choice[QUES];
printf ("please enter answer keys\n\n");
for (i=1;i<=QUES;i++)
{
scanf ("%c",&answer[i]);
}
for (i=1;i<=STUD;i++)
{
printf ("Please enter Student No. %d's Choices \n\n",i);
for (i=1;i<=QUES;i++)
{
scanf ("%c",&choice[i]);
}
for (i=1;i<=QUES;i++)
{
if (answer[i]==choice[i])
{ printf ("Ques Number %d is CORRECT\n",i); }
else
printf ("Ques Number %d is WRONG\n",i);
}
}
getch();
system("cls");
/* COADED BY NIKHIL SAGAR */
}
/*........................END OF CODE.........................*/
i have a code for the same problem and that one is working very fine but that is huge.and also i would like to know the error of this code too.