1.Hello Word !!!
Kode Program :
#include<stdio.h>
#include<conio.h>
main()
{
printf("\n
Hello Word !!! \n");
printf("===============");
getch();
}
Kode Program :
#include<stdio.h>
#include<conio.h>
main()
{
int
n;
printf("\n
Cek Nilai Kelulusan \n");
printf("
-------------------\n");
printf("\nInput
Sebuah Nilai : ");
scanf("%i",
&n);
if
(n>=50)
printf("LULUS");
else
printf("TIDAK
LULUS");
getch();
}
Contoh 1:
Kode Program :
#include<stdio.h>
#include<conio.h>
main()
{
int
i;
for(i=1;
i<=5; i=i+1)
{
printf("\n
JAKARTA");
}
printf("\n
BANDUNG");
getch();
}
Hasil Program :
Contoh 2:
Kode Program :
#include<stdio.h>
#include<conio.h>
main()
{
int
i, j;
for(i=1;
i<=3; i++)
{
for(j=1;
j<=5; j++)
{
printf("%2i",
i);
}
}
getch();
}
Hasil Program :
Contoh 3:
Kode Program :
#include<stdio.h>
#include<conio.h>
main()
{
int
i, j;
for(i=1;
i<=3; i++)
{
for(j=1;
j<=5; j++)
{
printf("%2i",
i);
}
printf("\n");
}
getch();
}
Hasil Program :
0 comments:
Post a Comment