Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

Hasil compile pertanyaan

#include<stdio.h> #include<stdlib.h> #include<math.h> int rumusx1(int a,int b,int c); int rumusx2(int a,int b, int c); int rumusx1(int a,int b, int c) { return(((-b)-sqrt(b*b-4*a*c))/2*a); } int rumusx2(int a,int b,int c) { return(((-b)+sqrt(b*b-4*a*c))/2*a); } int main() { int a,b,c; float x1,x2; printf("masukan nilai a:"); scanf("%d",&a); printf("masukan nilai b:"); scanf("%d",&b); printf("masukan nilai c:");

scanf("%d",&c); x1=rumusx1(a,b,c); x2=rumusx2(a,b,c); printf("\nHasilnya x1:%f",x1); printf("\nHasilnya x2:%f",x2); printf("\n"); system("pause"); return 0; }

You might also like