0% found this document useful (0 votes)
8 views3 pages

Laptrinh

Uploaded by

vophuonghien10
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views3 pages

Laptrinh

Uploaded by

vophuonghien10
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

#include <stdio.

h>
#include <stdlib.h>
#include <math.h>
#include <conio.h>
main()
{
float a,b,c,delta;
printf("Nhap a=");
scanf("%f",&a);
printf("Nhap b=");
scanf("%f",&b);
printf("Nhap c=");
scanf("%f",&c);
if(a==0)
{
if(b==0)
{
if(c==0)

printf("pt co vo so nghiem");
else
printf("pt vo nghiem");
}
else printf("pt co nghiem=%f",-c/b);
}
else
{
delta=b*b-4*a*c;
if(delta<0)
printf("pt vo nghiem");
else
if(delta==0)
printf("pt co nghiem kep=%f",-b/(2*a));
else
{
printf("pt co 2 nghiem phan biet= %f,%f",(-b-sqrt(delta))/(2*a),(-b+sqrt(delta))/(2*a));
}
}
return 0;
}
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <conio.h>
main()
{
int t,n;
printf("nhap thang:");
scanf("%d",&t);
if (t>=1 && t<=12)
{
switch(t)
{
case 1: case 3: case 5: case 7: case 8: case 10: case 12:
printf("Thang %d co 31 ngay",t); break;
case 4: case 6: case 9: case 11:
printf("Thang %d co 30 ngay",t); break;
case 2:
printf("Nhap nam:");
scanf("%d",&n);
if (n%4==0)
printf("thang 2 co 29 ngay");
else
printf("Thang 2 co 28 ngay"); break;
}
}
else printf("Khong co thang nay");
return 0;
}
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <conio.h>
main()
{
float a,b;
printf("Nhap a=");
scanf("%f",&a);
printf("Nhap b=");
scanf("%f",&b);
if (a>b) printf("b la so nho nhat");
else printf("a la so nho nhat");
return 0;
}

You might also like