There are 2 questions, as I posted in the above.Code://question 1 int main() { int choice = -1, num1,num2,trials = 0; //give the user a max of five trials while((choice = -1) && trials <5) { printf("Enter a number : "); scanf("%d",&num1); printf("Enter another number: "); scanf("%d",&num2); printf("Their sum is %d\n",(num1+num2)); printf("Enter -1 to repeat, 1 to exit"); scanf("%d",&choice); trials++; } return 0; } //question 2 int a = -75; if(a != 0) { printf("The number is different from 0\n"); printf("Please enter another number \n"); } else if (a<0) printf("The number is negative \n"); else printf("The number is positive \n");
The question says there is one error in each questions.
I tried to find errors but, I couldn't find any....
I even tried to run the program and it worked fine.
Could anyone help me with finding errors?