PROGRAM
IF
ü IF3
//CODING
PROGRAM
#include
#include
int
main()
{
float
lama_kerja, gaji, bonus, total_gaji; // deklarasi float
printf("===---------------**---------------===
\n");
printf(" PROGRAM IF 'BONUS KARYAWAN' ");
printf("\n===---------------**---------------===
\n\n");
printf
("Lama Kerja : ");
scanf
("%f",&lama_kerja);
printf
("Gaji pegawai : ");
scanf
("%f",&gaji);
if
(lama_kerja > 2 && gaji > 2000000)
{
bonus=0.10*gaji;
}
else
{
bonus=0;
}
total_gaji
= bonus + gaji; // operasi penjumlahan
printf("\nGaji : %10.2f",gaji);
printf("\nBonus : %10.2f",bonus);
printf("\n-------------------------------");
printf("\nGaji
Total : %10.2f",total_gaji);
getche();
return
0;
}
//OUTPUT
PROGRAM
0 komentar:
Posting Komentar