Bài 3.1:include include include main(){float x, y, z, F ;printf ( Nhap ba so bat ky:);printf ( x=); scanf (%f, x);printf ( y=); scanf (%f, y);printf ( z=); scanf (%f, z);F=(x+y+z)(xx+yy+1) fabs(xzcos(y));printf ( Gia tri cua F=%f,F);getch();}Bài 3.2:include include define PI 3.14159main(){float r,M,S;printf ( Nhap so thuc r (r>0):);printf ( r=); scanf (%f, r);M=2PIr;S=PIrr;printf( Chu vi cua hinh tronM=%f, M);printf( Dien tich cua hinh tronS=%f, S);getch();}Bài 3.3:include include include main(){float X,Y,F;printf( Nhap hai so thuc X, Y);printf( X=); scanf(%f, X);printf( Y=); scanf(%f, Y);if(X==Y)F=7pow(Y,6);elseF=(pow(Y,7)pow(X,7))(YX);printf( Gia tri cua F=%6.f, F);getch();}Bài 3.4:include include main(){int a,b,P,S;printf(Nhap hai so nguyen a,b bat ky);printf( a=); scanf(%d,a);printf( b=); scanf(%d,b);P=2(a+b);S=ab;printf( Chu vi hinh chu nhat la: %d, P);printf( Dien tich hinh chu nhat la: %d, S);getch();}Bài 3.5:include include main(){float X,Y,a,b,c;printf( Nhap hai so thuc X, Y:);printf( X=);scanf(%f,X);printf( Y=);scanf(%f,Y);a=XX+YY;b=(X+Y)(X+Y);c=(XY)(XY);printf( X2 + Y2 = %10.f, a);printf( (X+Y)2 = %10.f, b);printf( (XY)2 = %10.f, c);getch();}Bài 3.6:include include main(){float toan,ly,hoa;printf(Nhap 3 diem toan, ly, hoa cua 1 hoc sinh);printf( Diem Toan = );scanf(%f,toan);printf( Diem Ly = ); scanf(%f,ly);printf( Diem Hoa = );scanf(%f,hoa);printf( Tong diem cua hoc sinh la %2.f,toan+ly+hoa);printf( Diem trung binh cua hoc sinh la %2.1f, (toan+ly+hoa)3);getch();}Bài 3.7:include include main(){int a,b,c;printf( Nhap ba so nguyen a, b, c bat ky);printf( a=);scanf(%d,a);printf( b=);scanf(%d,b);printf( c=);scanf(%d,c);printf( Tong 3 so la: %d,a+b+c);printf( Tich 3 so la: %d,abc);printf( Trung binh 3 so la: %d,(a+b+c)3);getch();}Bài 3.8:include include main(){int n,Sn;printf( Bai toan tinh tong Sn=1+2+3...+n);printf( Nhap so nguyen n=);scanf(%d,n);Sn=(n+1)n2;printf( Tong Sn=1+2+3+...+n=%d,Sn);getch();}Bài 3.9:include include main(){char c;printf(1.Nhap vao mot ky tu:); scanf(%c,c);printf(Ma ASCII tuong ung la: %d,c);int s;printf(2.Nhap vao mot so nguyen (tu 1 den 255):); scanf(%d,s);printf(Ky tu co ma ASCII tuong ung la: %c,s);getch();}
Bài 3.1: #include #include #include main() { float x, y, z, F ; printf (" Nhap ba so bat ky:"); printf ("\n x="); scanf ("%f", &x); printf (" y="); scanf ("%f", &y); printf (" z="); scanf ("%f", &z); F=(x+y+z)/(x*x+y*y+1) - fabs(x-z*cos(y)); printf (" Gia tri cua F=%f",F); getch(); } Bài 3.3: #include #include #include main() { float X,Y,F; printf(" Nhap hai so thuc X, Y"); printf("\n X="); scanf("%f", &X); printf(" Y="); scanf("%f", &Y); if(X==Y) F=7*pow(Y,6); else F=(pow(Y,7)-pow(X,7))/(Y-X); printf("\n Gia tri cua F=%6.f", F); getch(); } Bài 3.5: #include #include main() { float X,Y,a,b,c; printf(" Nhap hai so thuc X, Y:"); printf("\n X=");scanf("%f",&X); printf(" Y=");scanf("%f",&Y); a=X*X+Y*Y; b=(X+Y)*(X+Y); c=(X-Y)*(X-Y); printf("\n X^2 + Y^2 = %10.f", a); printf("\n (X+Y)^2 = %10.f", b); printf("\n (X-Y)^2 = %10.f", c); getch(); } Bài 3.2: #include #include #define PI 3.14159 main() { float r,M,S; printf (" Nhap so thuc r (r>0):"); printf ("\n r="); scanf ("%f", &r); M=2*PI*r; S=PI*r*r; printf("\n Chu vi cua hinh tron M=%f", M); printf("\n Dien tich cua hinh tron S=%f", S); getch(); } Bài 3.4: #include #include main() { int a,b,P,S; printf("Nhap hai so nguyen a,b bat ky"); printf("\n a="); scanf("%d",&a); printf(" b="); scanf("%d",&b); P=2*(a+b); S=a*b; printf("\n Chu vi hinh chu nhat la: %d", P); printf("\n Dien tich hinh chu nhat la: %d", S); getch(); } Bài 3.6: #include #include main() { float toan,ly,hoa; printf("Nhap diem toan, ly, hoa cua hoc sinh"); printf("\n Diem Toan = ");scanf("%f",&toan); printf("\n Diem Ly = "); scanf("%f",&ly); printf("\n Diem Hoa = ");scanf("%f",&hoa); printf("\n Tong diem cua hoc sinh la %2.f",toan+ly+hoa); printf("\n Diem trung binh cua hoc sinh la %2.1f", (toan+ly+hoa)/3); getch(); } Bài 3.7: #include #include main() { int a,b,c; printf(" Nhap ba so nguyen a, b, c bat ky"); printf("\n a=");scanf("%d",&a); printf(" b=");scanf("%d",&b); printf(" c=");scanf("%d",&c); printf("\n Tong so la: %d",a+b+c); printf("\n Tich so la: %d",a*b*c); printf("\n Trung binh so la: %d",(a+b+c)/3); getch(); } Bài 3.9: #include #include main() { char c; printf("1.Nhap vao mot ky tu:"); scanf("%c",&c); printf("\nMa ASCII tuong ung la: %d",c); int s; printf("\n\n2.Nhap vao mot so nguyen (tu den 255):"); scanf("%d",&s); printf("\nKy tu co ma ASCII tuong ung la: %c",s); getch(); } Bài 3.8: #include #include main() { int n,Sn; printf(" Bai toan tinh tong Sn=1+2+3 +n"); printf("\n\n Nhap so nguyen n=");scanf("%d",&n); Sn=(n+1)*n/2; printf("\n Tong Sn=1+2+3+ +n=%d",Sn); getch(); } ... co ma ASCII tuong ung la: %c",s); getch(); } Bài 3. 8: #include #include main() { int n,Sn; printf(" Bai toan tinh tong Sn=1+2 +3 +n"); printf(" Nhap so nguyen n=");scanf("%d",&n);... %d",a+b+c); printf(" Tich so la: %d",a*b*c); printf(" Trung binh so la: %d",(a+b+c) /3) ; getch(); } Bài 3. 9: #include #include main() { char c; printf("1.Nhap vao mot ky.. .Bài 3. 7: #include #include main() { int a,b,c; printf(" Nhap ba so nguyen a, b,