Header Ads

Header ADS

My First C project about Drawing Shape

aita dia tumi 4 ta shape akte parba. aktu buddi khataile ro onek kisu kora ji. doia kore copy kore niger nam e chalaio na. jani ku dekte parbe na tu bole raklam r ki.


#include<stdio.h>

int

main ()

{

  {

    printf ("Kon shape akbo??\n1.Triangle\n2.Rombos\n3.ioto\n4.square\n");

    int n;

    scanf ("%d", &n);

    if (n == 1)

      {

int i, j, k, rows, count, temp = 1;

printf ("akta bahur size koto dhorbo?\n");

scanf ("%d", &rows);

count = rows - 1;


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

  {

    for (j = 1; j <= count; j++)

      {

printf (" ");


      }

    for (k = 1; k <= temp; k++)

      {

printf ("*");

      }

    count--;

    temp += 2;


    printf ("\n");

  }

      }

    if (n == 2)

      {

int i, j, k, count, me;

printf

  ("Boro korner map ta dau ami try korsi\nBiddrup: shonka ta jor hole valo hoto\nmane dekte sundor lagto r ki\n");

scanf ("%d", &me);

count = me / 2;

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

  {

    for (k = 1; k <= count + 1; k++)

      {

printf (" ");

      }

    count--;

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

      {

printf ("*");

      }

    printf ("\n");

  }

count = 1;

for (i = me + 1; i >= 1; i -= 2)

  {

    for (k = 1; k <= count; k++)

      {

printf (" ");

      }

    count++;

    for (j = i; j >= 1; j--)

      {

printf ("*");

      }

    printf ("\n");

  }

      }

    if (n == 3)

      {

int i, j, num, me;

printf ("Doigho koto?\n");

scanf ("%d", &me);

printf ("R prosto?\n");

scanf ("%d", &num);

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

  {

    for (j = 1; j <= me; j++)

      {

printf ("* ");


      }

    printf ("\n");

  }

      }

    if (n == 4)

      {

int i, j, num;

printf ("J kono akta bahur map dau deki kisi korte pari kina\n");

scanf ("%d", &num);

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

  {

    for (j = 1; j <= num; j++)

      {

printf ("* ");


      }

    printf ("\n");

  }

      }

    if (n < 1 || n > 4)

      {

printf ("sorry!!!vi/bon tumi vul number diaso\n1-4 er modde akta shonka diba tu thik thak likte paro na!!!\nabar try koro");

      }

    printf

      ("\n\nDhonnobad amar program use korar jonno\namar jinno doa koiro\n");

  }

  return 0;

}




kisu nomuna dia di ki bolo


Borgo

Ioto

Trivug

rombos




No comments

Powered by Blogger.