Can some 1 debug this for me and help me print the output
Ok so heres the deal. I need the program to print in two columns, one with the number of quizzes two wit the grade from each quiz, and then at the end i need the average to print, here is the code so far
Code:
int main()
{
//Define Varibles int and floats
int gone,gtwo,gthree,gfour,gfive,gsix,gseven,geight,gnine,gten,k,avg,sum;
//User Input
printf("Please enter the 10 grades, make sure you space and use commas to differentiate each grade");
scanf("%i,%i,%i,%i,%i,%i,%i,%i,%i,%i",&gone,>wo,>hree,&gfour,&gfive,&gsix,&gseven,&geight,&gnine,>en);
//Check Input
if (gone == -gone||gtwo == -1||gthree == -gthree||gfour == -gfour||gfive == -gfive||gsix == -gsix||gseven == -gseven||geight == -geight||gnine == -gnine||gten == -gten)
printf("Please enter a positive grade. Grades can not be negative");
else
{
sum = gone+gtwo+gthree+gfour+gfive+gsix+gseven+geight+gnine+gten;
avg = sum/10;
{
while(k <=10)
{
k++;
printf("%i,%i",k,avg);
}
return 0;
}