JAWABAN (Syntax menggunakan java)
1.
int a,b,c,i;
a=0; b=1; c=0;
for(i=1;i<=5;i=i+1)
{
a=a+b;
b=b+c;
c=c+1;
System.out.printf("\n %d", c);
}
2.
int a,b,c,i;
a=0; b=1; c=6;
for(i=1;i<=5;i=i+1)
{
a=a-b;
b=b-c;
c=c-1;
System.out.printf("\n %d", c);
}
3.
int i;
System.out.printf("\n STMIK");
for(i=1;i<=3;i=i+1)
{
System.out.printf("\n Swadharma");
}
System.out.printf("\n OK");
4.
int a,b,c,i;
a=1; b=0; c=1;
System.out.printf("\n STMIK - %d", a);
for(i=1;i<=3;i=i+1)
{
a=a+b;
b=b+c;
c=c+1;
System.out.printf("\n Swadharma - %d", c);
}
System.out.printf("\n OK - %d", a);
5.
int a,b,c,i;
a=5; b=13; c=5;
System.out.printf("\n OK - %d", a);
for(i=1;i<=3;i=i+1)
{
a=a-b;
b=b-c;
c=c-1;
System.out.printf("\n Swadharma - %d", c);
}
System.out.printf("\n OK - %d", b);
6.
int b,c,i;
b=1; c=0;
for(i=1;i<=10;i=i+1)
{
b=1000*i;
c=c+1;
System.out.printf("\n %d Kilometer = %d Meter", c, b);
}
7.
int a,b,c,i;
a=0; b=0; c=0;
for(i=1;i<=5;i=i+1)
{
a=a+1;
b=a*i;
c=c+1;
System.out.printf("\n %d Kilometer = %d Meter", c, b);
}