In a test with 26 questions, five points were deducted for each wrong answer and eight points were added for every correct answer. How many were answered correctly if the score was zero? this can be implemented through a c code

#include <stdio.h>
void main()
{
    int x,y,temp;
    for(x=0;x<=26;x++){
    for(y=0;y<=26;y++){
         temp = x*(-5)+y*(8);
         if(temp==0)
         printf("%d wrng \n %d right\n",x,y);
    }
    
  }
}   
    

output:

0 wrng 
 0 right
8 wrng 
 5 right
16 wrng 
 10 right
24 wrng 
 15 right

Posted on by