0

C exam question

int main() { int i, j, val=1, s=0; int arr[4][4], brr[4][4]; for (i=0; i<4; i++) for (j=0; j<4; j++, val++) { arr[i][j] = val; brr[j][i] = val; } for (i=0; i<3; i++) for (j=0; j<4; j++) s += arr[i][j]–brr[i][j]; printf("%d", s); return 0;} ı cant execute this code. Do you see any problem in this code?

30th May 2019, 10:50 AM
Osman Uçkan
Osman Uçkan - avatar
8 Answers
+ 1
Dude, did you included std liberies in ur code??
30th May 2019, 11:36 AM
Sanjeev Singh
+ 1
#include <stdio.h> #include <condo.h> int main() {
30th May 2019, 11:37 AM
Sanjeev Singh
+ 1
yes
30th May 2019, 12:09 PM
Osman Uçkan
Osman Uçkan - avatar
+ 1
There's is mistake in intedention in ur program .. After first for loop use { Coz u r using nests for loop here.
30th May 2019, 12:13 PM
Sanjeev Singh
0
what is intedention and ı dont understand where ı should use {}
30th May 2019, 12:19 PM
Osman Uçkan
Osman Uçkan - avatar
0
for (i=0; i<4; i++) { for (j=0; j<4; j++,val++) {
30th May 2019, 12:21 PM
Sanjeev Singh
0
Same for another proceeding loops
30th May 2019, 12:22 PM
Sanjeev Singh
0
ıt doesnt work
30th May 2019, 12:24 PM
Osman Uçkan
Osman Uçkan - avatar