Home > Back-end >  Simulated exam, please answer
Simulated exam, please answer

Time:01-05

1. # include "stdio.h"
The main ()
,5,8,3,9,1 {int a [6]={12}, I, k;
for(i=0; i<6; I++)
If (a [I] <8)
A [I]=0;
for (i=0; i<6; I++)
Printf (" % 4 d ", a [I]);
}
Results: __________________
2. # include "stdio.h"
The main ()
{int a=5, b=100;
If (a==10)
{a=a + 2; B=b + 2; }
The else
{a=a + 4; B=b + 4; }
Printf (" % d; % d \ n ", a, b);
}
Results: __________________
3,
# include "stdio.h"
Int fun (int x, int y)
{
Return (x + y);
}
# include & lt; Stdio. H>
The main ()
{int a=1, b=2, c=0;
Printf (" % d, % d, % d \ n ", a, b, c);
C=fun (a, fun (a, b));
Printf (" % d, % d, % d \ n ", a, b, c);
}
Results: __________________
4,
# define M 5
# include & lt; Stdio. H>
The main ()
{int a [M] [M], I, j, sum=0;
For (I=0; iFor (j=0; JA [I] [j]=2 * (I + 1) + j.
For (I=0; iFor (j=I; JSum=sum + a, [I] [j].
Printf (" % d \ n ", sum);
}
Results: __________________
5,
# include & lt; Stdio. H>
The main ()
{int I, a=1;
For (I=1; i<=10; I++)
{if (a>=10) break;
If (a % 3==1) a=a + 2;
Else a=a + I;
}
Printf (" % d % d \ n \ n ", I, a);
}
Results: __________________

CodePudding user response:

This is where you learn C language? How look so difficult, use the standard C not sweet,

CodePudding user response:

Is this test

CodePudding user response:

refer to the second floor m0_54250581 response:
is this test

At least do not conform to the C99 standard, congratulations you, through 20 years ago,,
  • Related