[ create a new paste ] login | about

Link: http://codepad.org/IWaP5vb1    [ raw code | output | fork ]

C, pasted on Sep 6:
#include<stdio.h>
#include<conio.h>

float Tinh(float x)
{
	float ketqua;
	if(x >= 5)
		ketqua = 2 * x * x + 5 * x + 9;
	else
		ketqua = -2 * x * x + 4 * x - 9;
	return ketqua;

}
int main()
{
	float x;
	printf("\nNhap x: ");
	scanf("%f", &x);
	float ketqua = Tinh(x);
	printf("\nKet qua = %f", ketqua);

	getch();
	return 0;
}


Output:
1
Line 17: error: conio.h: No such file or directory


Create a new paste based on this one


Comments: