CHỈ MANG TÍNH THAM KHẢO NHÉ, NO CHÉM!!! PHP: Tong S= 1^2+...n^2 #include<stdio.h>#include<conio.h>void main(){int n;printf("Nhap so nguyen: ");scanf("%d",&n);int s=0;for(int i=1; i<=n;i++){s+=(i*i);}printf("\n%d",s); getch();} Bai doi goc sang do radian #include<stdio.h>#include<conio.h> #define pi 3.1416 float DoiGoc(float x){float y;y = x*pi/180;return y;}void main(){float x;printf("Nhap goc can doi: ");scanf("%f",&x);printf("Goc radian: %0.2f ", DoiGoc(x));getch();} Tam giac vuong #include<stdio.h>#include<conio.h> void TamGiacVuong(int a, int b, int c){if((a*a==b*b+c*c)||(a*a+b*b==c*c)||(a*a+c*c==b*b))printf("Tam giac vuong!");else printf("Khong phai tam giac vuong!");}void main(){int a, b, c;printf("Nhap canh a:");scanf("%d",&a);printf("Nhap canh b:");scanf("%d",&b);printf("Nhap canh c:");scanf("%d",&c);TamGiacVuong(a,b,c);getch();} bai toan nhap so nguyen duong, xet chan le #include<stdio.h>#include<conio.h>void main(){int n;printf("Nhap so nguyen: ");scanf("%d",&n);if(n%2==0){printf("n= %d\n",n);for(int i=2; i<n;i+=2)printf("%d\n",i);}getch();} Bai toan UCLN #include<stdio.h>#include<conio.h> int UCLN(int a, int b){while(a!=b){if(a>b) a=a-b;else b=b-a;}return a;}void main(){int a, b, c;printf("Nhap so a:");scanf("%d",&a);printf("Nhap so b:");scanf("%d",&b);printf("UCLN = %d",UCLN(a,b));getch();} [SIZE=4][B][FONT=Times New Roman][COLOR=#000000]Mang so thuc, in gia tri lon nhat[/COLOR][/FONT][/B][/SIZE] [SIZE=4][FONT=Times New Roman][COLOR=#000000]#include<stdio.h>#include<conio.h>void main(){float A[100],max;int i,n,dem=0;printf("Moi nhap so phan tu mang: \n");scanf("%d",&n);for(i=0;i<n;i++){ printf("A[%d] = ",i);scanf("%f",&A[i]); }printf("\nMang vua nhap la: \n");for(i=0;i<n;i++){printf("%f \t",A[i]);}max=A[0];for(i=1;i<n;i++){ if(A[i]>max){max=A[i];dem++};}printf("Gia tri lon nhat cua mang la: %f, o vi tri thu: %d",max,dem);getch();}[/COLOR][/FONT][/SIZE]