[ASK] Problem Bahasa C

Aplikasi-aplikasi diubuntu: • Aplikasi Grafis •
Aplikasi Internet •
Aplikasi Office •
Aplikasi Sound & Video •
Aplikasi Programming
User avatar
k0r0
Posts: 33
Joined: 06 Nov 2010, 20:36
Location: Makassar
Contact:

[ASK] Problem Bahasa C

Postby k0r0 » 17 May 2011, 17:17

Help.

main()
{
int gaji_jam,jam_lembur,gaji_lembur;
float jam_kerja,gaji;
printf ("Masukkan jam kerja");
scanf ("%f",&jam_kerja);
if ("jam_kerja>7");
{
jam_lembur=jam_kerja-7;
gaji_lembur=jam_kerja*7500;
gaji=7*500+gaji_lembur;
printf ("Gaji harian pekerja adalah : %f",gaji);
}
else ;
{
gaji=jam_kerja*500;
printf ("Gaji harian pekerja adlaah : %f",gaji);
}
}


Tolong bagi yang Programmer, bantuin check bagian mana yang salah.?

Regards.~
User avatar
saa7_go
Posts: 464
Joined: 21 Jan 2011, 23:37
Contact:

Re: [ASK] Problem Turbo C

Postby saa7_go » 17 May 2011, 18:05

bukannya Turbo C itu program windows? kenapa ditanyakan ke forum ubuntu???? codelitenya dipakai buat apa kalo gitu? =="
User avatar
k0r0
Posts: 33
Joined: 06 Nov 2010, 20:36
Location: Makassar
Contact:

Re: [ASK] Problem Turbo C

Postby k0r0 » 17 May 2011, 18:07

[quote=saa7_go]bukannya Turbo C itu program windows? kenapa ditanyakan ke forum ubuntu???? codelitenya dipakai buat apa kalo gitu? =="


yah, maksudnya tolong check apanya yang salah.
karena aku compile gcc check.cpp -o check.out

r-a-k@rak:~/Desktop/asd$ gcc check.cpp -o check.out
1.cpp: In function �int main()�:
1.cpp:5:29: error: �printf� was not declared in this scope
1.cpp:6:23: error: �scanf� was not declared in this scope
1.cpp:14:1: error: �else� without a previous �if�