Escolar Documentos
Profissional Documentos
Cultura Documentos
VN
Cu hi v p n C++
Cu 69 : Cho bit bin f sau khi thc hin sau dng lnh
sau c gi tr bao nhiu:
float f = 3/5;
-- >> (*)[c] 0.00
Cu 70 : Cho bit trong chng trnh sau y dng no c
li:
1 / #include <stdio.h>
2 / void main()
3 / { int a, b, c;
4 / printf("\nCho a: ");
5 / scanf("%d", &a);
6 / printf("\nCho b: ");
7 / scanf("%d", b);
8 / printf("\na = %d, b = %d", a, b);
9/}
-- >> (*)[c] 7
Cu 71 : Cho chng trnh sau y
#include <stdio.h>
void sapxep(float *pa, int i)
{ int i,j; float c;
for(i=0;i<n-1;i++) for(j=i+1;j<n;j++)
if ( #1) { c=pa[i]; pa[i]=pa[j]; pa[j]=c;}
}
void main()
{ int n = 5; float a[5]={ 4.5, 8.0, 1.0, -6.2, 7.8};
#2;}
Cho cc biu thc v li gi tng ng vi cc k hiu #1
v #2 di y.
Hy chn p n ng
-- >> (*)[c] pa[j]<pa[i] v sapxep(a,n)
Cu 72 : Cho nguyn mu hm sau:
FILE *fopen(const_char *FileName, Const_char Type);
Gi tr tr v ng ca hm thuc kiu
-- >> (*)[d] con tr tp
Cu 73 : Cho on chng trnh sau
#include <stdio.h>
#include<conio.h>
void doubleinc(int * p, int q){
*p++; ++q
}
void main(){
int a=10,b = 20;
doubleinc(&a, b);
printf("\n%d\t%d", a, b);
getch();
}
Kt qu trn mn hnh xut hin
-- >> (*)[d] 11
20
Cu 74: Cho on chng trnh sau:
int a = 0;
switch (a)
{ case 0: printf("Red ");
case 1: printf("Green "); break;
case 2: printf("Blue ");
case 3: printf("White "); break;
}
Kt qu thc hin cu trc trn y s nh th no?
-- >> (*)[b] Red Green
l du ba chm.
int Max(int *m, int n)
{ int M = m[0];
for (int i = 1; i < n; i++)
if (M ... m[i]) M = m[i];
return M;
}
K t b xo l k t no?
-- >> (*)[d] <
Cu 98 : Hm sau y d kin dng sp xp cc
xu theo th t alphabet:
void SapXep(char **Ds, int n)
{ for (int i = 0; i < n - 1; i++)
for (int j = i + 1; j < n; j++)
if (strcmp(Ds[j], Ds[i]) > 0)
{ char *s = Ds[j];
Ds[j] = Ds[i];
Ds[i] = s;
}
}
Theo bn hm ny vit ng hay sai?
-- >> (*)[b] Sai
CongDongHUBT.VN