[ create a new paste ] login | about

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

C, pasted on Dec 1:
#include<stdio.h>
#include<conio.h>

struct DuongThang
{
	float a;
	float b;
	float c;
};
typedef struct DuongThang DUONGTHANG;

void NhapDuongThang(DUONGTHANG &);
void XuatDuongThang(DUONGTHANG);

void NhapDuongThang(DUONGTHANG &dt)
{
	float temp;
	printf("\nNhap he so a: ");
	scanf("%f", &temp);
	dt.a = temp;

	printf("\nNhap he so b: ");
	scanf("%f", &temp);
	dt.b = temp;

	printf("\nNhap he so c: ");
	scanf("%f", &temp);
	dt.c = temp;
}

void XuatDuongThang(DUONGTHANG dt)
{
	printf("%8.3fx + %8.3fy + %8.3f = 0", dt.a, dt.b, dt.c);
}

int main()
{
	DUONGTHANG dt;
	NhapDuongThang(dt);
	XuatDuongThang(dt);
	getch();
	return 0;
}


Output:
1
2
3
Line 17: error: conio.h: No such file or directory
Line 12: error: expected ';', ',' or ')' before '&' token
Line 15: error: expected ';', ',' or ')' before '&' token


Create a new paste based on this one


Comments: