No 1
#include "stdio.h"
int main()
{
int i=0,j=0,k=0,l;
for (i=5;i>=1;i-=2)
{
/*
l=0;
for (k=0;k<=l;k++)
{
printf(” “);
l=l+2;
}*/
for (j=1;j<=i;j++)
{
printf(“*”);
}
printf(“\n”);
}
getch();
return 1;
}
No.2
#include "stdio.h"
int main(){
int bil=0;
int ketemu=0;
printf(“masukkan angka: “); scanf(“%d”,&bil);
if ((bil%2!=0)||(bil==2)){
printf(“prima”);
ketemu=1;
}
else{
printf(“bukan prima”);
};
if(ketemu==1){
if(bil%3==0){
printf(“kelipatan 3″);
}
else(“bukan kelipatan 3″);
};
getch();
return 1;
}
#include
int main()
{
int i=0,j=0,k=0,l;
for (i=5;i>=1;i-=2)
{
/*
l=0;
for (k=0;k<=l;k++)
{
printf(” “);
l=l+2;
}*/
for (j=1;j<=i;j++)
{
printf(“*”);
}
printf(“\n”);
}
getch();
return 1;
}
No.2
#include "stdio.h"
int main(){
int bil=0;
int ketemu=0;
printf(“masukkan angka: “); scanf(“%d”,&bil);
if ((bil%2!=0)||(bil==2)){
printf(“prima”);
ketemu=1;
}
else{
printf(“bukan prima”);
};
if(ketemu==1){
if(bil%3==0){
printf(“kelipatan 3″);
}
else(“bukan kelipatan 3″);
};
getch();
return 1;
}