Skip to content

Instantly share code, notes, and snippets.

@rkhang7
Created November 15, 2018 03:08
Show Gist options
  • Save rkhang7/ab600a8426c89b10d4ad90a46831920a to your computer and use it in GitHub Desktop.
Save rkhang7/ab600a8426c89b10d4ad90a46831920a to your computer and use it in GitHub Desktop.
// giai pt ax+b=0
#include <stdio.h>
int main()
{
int a,b;
printf("a=");scanf("%d",&a);
printf("b=");scanf("%d",&b);
if(a==0&&b==0) printf("PT co vo so nghiem");
if(a==0&&b!=0) printf("PT vo nghiem");
if(a!=0&&b!=0) printf("PT co nghiem la %f",float(-b)/a);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment