Professional Documents
Culture Documents
033Z03A1 Experiment 2021 - 22 - 1 Final
033Z03A1 Experiment 2021 - 22 - 1 Final
Ⅰ. Programming A ( 30 marks)
Write a program to input an integer value no more than 4 digits, determine and tell the number of
digits.
Specification of output:
1 digit: one figure 2 digits: two figures
3 digits: three figures 4 digits: four figures
Invalid:Invalid number
【sample input】
356
【sample output】
three figures
IV. Prrogrammin
ng D(10 maarks)
Fill thee blank in thee program too finish the program
p and show the folllow
graphic.
【sampple graphic】
【proggram code】
#includde<stdio.h>
void drraw(int m,int n,char c);
int maiin(void)
{
int i;
<=7;++i)
for(i=1;i<
{
w(7-i,2*i-1,_______);
draw
}
>=1;--i)
for(i=6;i>
{
w(7-i,2*i-1,_______);
draw
}
return 0;
}
void drraw(______)
{
int j;
<m;++j)
for(j=0;j<
{
printtf(" ");
}
2/3
for(j=0;j<n;++j)
{
printf(______);
}
printf("\n");
}
3/3