R4R
Right Place For Right Person TM
 
R4R C C ExamplesPrint Star Triangle Using C
previous

Home

Next

Learn C with example

Print Star Rectangle in C

 

In this example we are going to explain how we can make a star rectangle using C language.

In this example we are inserting number of rows and columns .Then we are printing stars to make rectangle.

 

Source Code of Example

/*   * * * *
     * * * *
     * * * *
     * * * *  print it  */
     #include<stdio.h>
     #include<conio.h>
     void main()
     {
     int i,j,row,col;
     clrscr();
     printf("Enter the row and column\t");
     scanf("%d%d",&row,&col);
     for(i=1;i<=row;i++)
     {
     for(j=1;j<=col;j++)
     printf("*");
     printf("\n");
     }
     getch();
     }

Output Of Example

Enter the row and column 4 4

* * * *
* * * *
* * * *
* * * *

previous

Home

Next

New Updates

R4R
R4R
R4R
R4R
R4R
R4R
R4R
R4R