Section C: Error Detection and Correction [5 marks] Find the errors in the following code and correct them. Answer all q
-
- Posts: 43759
- Joined: Sat Aug 07, 2021 7:38 am
Section C: Error Detection and Correction [5 marks] Find the errors in the following code and correct them. Answer all q
questions. 1) if(choice = 3) printf("You have chosen: Wizard!\n"); 2) for(i=0; i > NAME_LENGTH ;i++) printf("%c\n", MyArray); 3) void main() { int V, i; for(i=0; i < 3; i++) V += speed+gravity-thrust; printf(" Speed=%d\n", V); } 4) void main() { int i=0, Array1[10], Array2[10] = {1,2,3,4,5,6,7,8,9,0}; Array1 = Array2; for (i=0; i<10; i++) printf ("%d+%d=%d\n", Array1, Array2, Array1 +Array2); } 5) while(p, !Quit_loop) { } printf("String is %s\n", p->name); p= *p->next; if (!p) Quit_loop = TRUE;
Section C: Error Detection and Correction [5 marks] Find the errors in the following code and correct them. Answer all