0% found this document useful (0 votes)
36 views3 pages

Proyek Akhir Dasar Komputer "Pedang"

This C program allows the user to input a character and then prints out that character in the shape of a sword using nested for loops. The character is printed in increasing and decreasing rows to form the handle, a long straight section for the blade, and then several shorter rows to form the tip of the sword.

Uploaded by

Bambang Arie S
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views3 pages

Proyek Akhir Dasar Komputer "Pedang"

This C program allows the user to input a character and then prints out that character in the shape of a sword using nested for loops. The character is printed in increasing and decreasing rows to form the handle, a long straight section for the blade, and then several shorter rows to form the tip of the sword.

Uploaded by

Bambang Arie S
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Ibrahim Azizi

Teknik Elektro UI 2013


1306405622

Proyek Akhir Dasar Komputer


“Pedang”

#include <stdio.h>

int main ()

{
char x;
int i;
int j;

printf ("Input Pilihan Karakter: ");


scanf ("%c", &x);

printf ("\n ");

for (i = 1; i <= 5; i++)


{
for (j = i; j >= 1; j--)
{
printf ("%2c", x);
}
printf ("\n ");
}

for (i = 1; i <= 30; i++)


{
for (j = 1; j <= 5; j++)
{
printf ("%2c", x);
}
printf ("\n ");
}

for (i = 1; i <= 2; i++)


{
for (j = 1; j <= 7; j++)
{
printf ("%2c", x);
}
printf ("\n ");
}

for (i = 1; i <= 2; i++)


{
for (j = 1; j <= 3; j++)
{
printf ("%2c", x);
}
printf ("\n ");
}

for (i = 1; i <= 9; i++)


{
for (j = 1; j <= 2; j++)
{
printf ("%2c", x);
}
printf ("\n ");
}

for (i = 1; i <= 2; i++)


{
for (j = 1; j <= 3; j++)
{
printf ("%2c", x);
}
printf ("\n ");
}

You might also like